Howto contribute a perspective to a perspective stack? [message #918842] |
Fri, 21 September 2012 07:54  |
Eclipse User |
|
|
|
Hi,
I want to contribute a complete perspective including the views from a
fragment.e4xmi to the application model.
Inside the Application.e4.xmi I have defined:
<children xsi:type="basic:TrimmedWindow"
xmi:id="_XwsN6gMWEeKkEbp87BcYwQ" label="Application" width="500"
height="400">
<children xsi:type="advanced:PerspectiveStack"
xmi:id="_XwsN8gMWEeKkEbp87BcYwQ" elementId="de.ww.perspectivestack"
selectedElement="_XwsN8wMWEeKkEbp87BcYwQ">
<children xsi:type="advanced:Perspective"
xmi:id="_XwsN8wMWEeKkEbp87BcYwQ" elementId="de.ww.core.perspective"
label="Perspective">
<children .........
At my fragment.e4xmi I have defined the following Model Fragment:
<fragments xsi:type="fragment:StringModelFragment"
xmi:id="_kAkdUAPVEeKUqvnYpyiNPg" featurename="children"
parentElementId="de.ww.perspectivestack">
<elements xsi:type="advanced:Perspective"
xmi:id="_pZ4EUAPVEeKUqvnYpyiNPg" elementId="de.ww.docmgmt.perspective"
label="DocMgmt">
<children xsi:type="basic:PartSashContainer"
xmi:id="_BVhKoAPBEeKUqvnYpyiNPg"
elementId="de.ww.docmgmt.partsashcontainer.main" horizontal="true">
....
....
....
</children>
</elements>
</fragments>
I also add some more model fragments with handlers and commands.
So I add a Handler to switch to the defined perspective with the
following code:
@Execute
public void execute(MApplication app, EModelService modelService,
EPartService partService) {
MPerspective element =
(MPerspective) modelService.find("de.ww.docmgmt.perspective", app);
partService.switchPerspective(element);
}
But this method doesn't find the defined perspective and the
modelservice returns a null.
What have I do wrong???
Thanks in advance
Heiko
|
|
|
|
|
|
Powered by
FUDForum. Page generated in 0.24288 seconds