TreeViewer with properties view support [message #695238] |
Mon, 11 July 2011 07:11  |
Eclipse User |
|
|
|
Hi,
I have defined a treeviewer by using the follwing lines of code
viewer.setContentProvider(new AdapterFactoryContentProvider(factory));
viewer.setLabelProvider(new AdapterFactoryLabelProvider(factory));
In order to support the properties view I implemented the ISelectionProvider interface specifying this method:
@Override
public ISelection getSelection() {
IStructuredSelection selection = (IStructuredSelection)viewer.getSelection();
if (selection.getFirstElement() == null)
return StructuredSelection.EMPTY;
IItemPropertySource source = (IItemPropertySource)factory.adapt(selection.getFirstElement(), IItemPropertySource.class);
return new StructuredSelection(new PropertySource(selection.getFirstElement(), source));
}
The problem is that the Properties View is displaying nothing even though the code gets executed. What is missing?
Ralph
|
|
|
|
|
|
|
|
Powered by
FUDForum. Page generated in 0.06279 seconds