Skip to main content

Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Rich Client Platform (RCP) » JFace TreeViewer Connected with PropertiesView
JFace TreeViewer Connected with PropertiesView [message #886257] Thu, 14 June 2012 15:09 Go to next message
ModelGeek Mising name is currently offline ModelGeek Mising nameFriend
Messages: 550
Registered: June 2011
Senior Member

I have a treeviewer showing model. I have added extension point "org.eclipse.core.runtime.adapters" and i have mentioned factory and type as well for extension point.

I have followed the tutotrial

but when i select any of my tree item i get the following exception and Properties views remain empty.

org.eclipse.core.runtime.AssertionFailedException: assertion failed:
at org.eclipse.core.runtime.Assert.isTrue(
at org.eclipse.core.runtime.Assert.isTrue(
at org.eclipse.ui.internal.views.ViewsPlugin.getAdapter(
at org.eclipse.ui.internal.AbstractSelectionService.firePostSelection(
at org.eclipse.ui.internal.AbstractSelectionService$2.selectionChanged(
at org.eclipse.jface.viewers.StructuredViewer$
at org.eclipse.ui.internal.JFaceUtil$
at org.eclipse.jface.viewers.StructuredViewer.firePostSelectionChanged(
at org.eclipse.jface.viewers.StructuredViewer.handlePostSelect(
at org.eclipse.jface.viewers.StructuredViewer$5.widgetSelected(
at org.eclipse.jface.util.OpenStrategy.firePostSelectionEvent(
at org.eclipse.jface.util.OpenStrategy.access$5(
at org.eclipse.jface.util.OpenStrategy$
at org.eclipse.swt.widgets.Synchronizer.runAsyncMessages(
at org.eclipse.swt.widgets.Display.runAsyncMessages(
at org.eclipse.swt.widgets.Display.readAndDispatch(
at org.eclipse.ui.internal.Workbench.runEventLoop(
at org.eclipse.ui.internal.Workbench.runUI(
at org.eclipse.ui.internal.Workbench.access$4(
at org.eclipse.ui.internal.Workbench$
at org.eclipse.core.databinding.observable.Realm.runWithDefault(
at org.eclipse.ui.internal.Workbench.createAndRunWorkbench(
at org.eclipse.ui.PlatformUI.createAndRunWorkbench(
at ics.eaat.concretemodeller.main.Application.start(
at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.runApplication(
at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.start(
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(
at sun.reflect.DelegatingMethodAccessorImpl.invoke(
at java.lang.reflect.Method.invoke(
at org.eclipse.equinox.launcher.Main.invokeFramework(
at org.eclipse.equinox.launcher.Main.basicRun(
at org.eclipse.equinox.launcher.Main.main(

Any idea why it is so?

Re: JFace TreeViewer Connected with PropertiesView [message #886315 is a reply to message #886257] Thu, 14 June 2012 17:45 Go to previous messageGo to next message
Simon Scholz is currently offline Simon ScholzFriend
Messages: 73
Registered: April 2012
Location: Germany
Hello ModelGeek,

I just looked for you @ my code, where I also use the Properties View, in order to see what is going wrong.

It seems that your object, which is passed to the Properties View on selection change, implements the IAdaptable interface.
The ViewsPlugin checks in line 100, if your sourceObject is an instace of IAdaptable and then asks for an Adapter of the IPropertySourceProvider.class and your sourceObject will wrongly return something different then null.

So please check the getAdapter method of your sourceObject and return null, if the class which is ask for is not the desired one.

For instance :
public class YourSourceObject implements IAdaptable{

public Object getAdapter(Class adapter){
    if(adapter == DesiredAdapter.class){
           return new YourAdapterClass();

return null;


So return null, if the adapter class is not appropriate, and it should work.

Here you can find also a nice tutorial concerning Adapters in Eclipse :

If anything is not clear donĀ“t hesitate to ask me.
Looking forward to your feedback Smile

Best regards,


[Updated on: Thu, 14 June 2012 17:48]

Report message to a moderator

Re: JFace TreeViewer Connected with PropertiesView [message #886605 is a reply to message #886315] Fri, 15 June 2012 09:10 Go to previous message
ModelGeek Mising name is currently offline ModelGeek Mising nameFriend
Messages: 550
Registered: June 2011
Senior Member
thanks alot.

very nice article!
Previous Topic:Tile Editor horizontal/vertical programmatically
Next Topic:Eclipse 4 Application Tutorial available (for Eclipse 4.2 M5)
Goto Forum:

Current Time: Tue May 22 00:12:41 GMT 2018

Powered by FUDForum. Page generated in 0.02302 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top