Declaring parts being based on PartDescriptors in E4XMI [message #926051] |
Fri, 28 September 2012 05:01  |
Eclipse User |
|
|
|
Hi,
I have an application that needs to open three instances of the same part when starting up. I described the PartDescriptor but I can't get the parts being instantiated when the application comes up.
1) Is it possible to reference the part descriptor in the part description within e4xmi file? If so, how?
2) If not, at what stage I can use partService.create(descriptorId) to programmatically create the parts? I wasn't able to find a hook in the lifecycle where this is possible. Usually it throws an application saying that the application doesn't have any active window yet, e.g.
java.lang.IllegalStateException: Application does not have an active window
at org.eclipse.e4.ui.internal.workbench.ApplicationPartServiceImpl.getActiveWindowService(ApplicationPartServiceImpl.java:36)
at org.eclipse.e4.ui.internal.workbench.ApplicationPartServiceImpl.createPart(ApplicationPartServiceImpl.java:95)
at myapp.rcp.ui.model.ApplicationLifecycleHook.addPart(ApplicationLifecycleHook.java:143)
at myapp.rcp.ui.model.ApplicationLifecycleHook.configurePerspective(ApplicationLifecycleHook.java:109)
at myapp.rcp.ui.model.ApplicationLifecycleHook.elementVisible(ApplicationLifecycleHook.java:78)
...
|
|
|
|
|
|
|
Re: Declaring parts being based on PartDescriptors in E4XMI [message #929842 is a reply to message #928977] |
Mon, 01 October 2012 16:31  |
Eclipse User |
|
|
|
Ok - that's what snippets are good for! Add your template there and add
a processor which clones the snippet to your final destination (IIRC the
model service has support for that) ;-)
Tom
Am 30.09.12 22:41, schrieb Ralph Schuster:
> Hi Tom,
>
> because the parts will have menus and toolbars that all need then be
> repeated, and I still would need the part descriptor to open a new
> instance dynamically.
> Of course this could be done in e4XMI, but the duplication of definition
> doesn't seem right at all to me.
>
>
|
|
|
Powered by
FUDForum. Page generated in 0.25109 seconds