Version 2 (modified by 17 years ago) (diff) | ,
---|
Create Model Navigator
[gmf <back]
- Create new view with a normal TreeViewer? (for example)
- Use
AdapterFactoryContentProvider
as content provider andAdapterFactoryLabelProvider
as label provider. It should be something like that:
AdapterFactory adapterFactory = ExhibitionDiagramEditorPlugin .getInstance().getItemProvidersAdapterFactory(); viewer.setContentProvider(new AdapterFactoryContentProvider(adapterFactory)); viewer.setLabelProvider(new AdapterFactoryLabelProvider(adapterFactory));
- Set the input of the viewer like that: (Maybe there is a better way, but I didn't found it yet...)
IEditorPart edp = PlatformUI.getWorkbench().getActiveWorkbenchWindow().getActivePage().getActiveEditor(); viewer.setInput(((DiagramDocumentEditor)edp).getEditingDomain().getResourceSet());
- You can inherit from the content and label provider to customize them for your needs.