|
Re: JFace TreeViewer Connected with PropertiesView [message #886315 is a reply to message #886257] |
Thu, 14 June 2012 17:45 |
|
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 :
www.eclipse.org/articles/article.php?file=Article-Adapters/index.html
If anything is not clear don´t hesitate to ask me.
Looking forward to your feedback
Best regards,
Simon
[Updated on: Thu, 14 June 2012 17:48] Report message to a moderator
|
|
|
|
Powered by
FUDForum. Page generated in 0.02847 seconds