WorkbenchLabelProvider [message #634076] |
Wed, 20 October 2010 09:11  |
Eclipse User |
|
|
|
Hi folks,
I'm currently doing my first steps in e4 application developement.
I associated the model part with my POJO class and everything
works quit well until now.
I want to use a JFace TreeViewer combined with a WorkbenchLabelProvider
that provides labels for adaptable objects.
The problem is that instanciating this LabelProvider fails with an
Exception:
....
Caused by: java.lang.IllegalStateException: Workbench has not been
created yet.
at org.eclipse.ui.PlatformUI.getWorkbench(PlatformUI.java:92)
at
org.eclipse.ui.model.WorkbenchLabelProvider.<init>(WorkbenchLabelProvider.java:76)
My code:
@PostConstruct
public void buildUI() {
....
viewer = new TreeViewer(parent, SWT.BORDER | SWT.MULTI | SWT.V_SCROLL);
Platform.getAdapterManager().registerAdapters(adapterFactory ,MyNode.class);
viewer.setLabelProvider(new WorkbenchLabelProvider()); // fails
viewer.setContentProvider(new BaseWorkbenchContentProvider());
viewer.setInput(rootNode);
....
}
I will be happy about any suggestions, how to solve this issue the
e4-ish way. :-)
TIA,
Jens
|
|
|
|
|
|
|
Powered by
FUDForum. Page generated in 0.25399 seconds