I'm considering how to port an existing RCP 3 Appl to the new e4 application platform and I have questions related to the concept of Perspectives.
1. If I have more than one perspective, are these perspectives defined in my application model through the PerspectiveStack/Perspective entries?
2. How do I define the initial perspective? In other words, where do I implement the functions provided by the getInitialWindowPerspectiveId() method of the workbench advisor component of RCP 3.x?
Am 07.05.12 16:22, schrieb Fausto Telia:
> I'm considering how to port an existing RCP 3 Appl to the new e4
> application platform and I have questions related to the concept of
> Perspectives.
>
> 1. If I have more than one perspective, are these perspectives defined
> in my application model through the PerspectiveStack/Perspective entries?
>
Yes.
> 2. How do I define the initial perspective? In other words, where do I
> implement the functions provided by the getInitialWindowPerspectiveId()
> method of the workbench advisor component of RCP 3.x?
>
If you look at the PerspectiveStack you should see a "Selected Element"
attribute this is the currently active Perspective.
Tom,
the getInitialPerspectiveId() method allows the RCP application at runtime to define which perspective should be the initial one based on some kind of application data, while the selected attribute in the Application model looks to me something to be set at definition time not at execution time.
Or is there any API that can be used when the RCP e4 appl starts in order to set the selected attribute in the application model so that the application may define the initial perspective?
Am 07.05.12 19:03, schrieb Fausto Telia:
> Tom,
> the getInitialPerspectiveId() method allows the RCP application at
> runtime to define which perspective should be the initial one based on
> some kind of application data, while the selected attribute in the
> Application model looks to me something to be set at definition time not
> at execution time.
> Or is there any API that can be used when the RCP e4 appl starts in
> order to set the selected attribute in the application model so that the
> application may define the initial perspective?
>
> fausto
No the code was from the top of my head - no IDE running :-)
Tom
Am 07.05.12 22:12, schrieb Fausto Telia:
> Tom,
> it works, but I had to change a little your code. This is my working sample
>
> @ProcessAdditions
> void process(MApplication app) {
>
> MWindow l = app.getChildren().get(0);
> MPerspectiveStack stack = (MPerspectiveStack)
> l.getChildren().get(0);
>
> MPerspective perspectiveA = stack.getChildren().get(0);
> System.out.println(perspectiveA.getLabel());
>
> MPerspective perspectiveB = stack.getChildren().get(1);
> System.out.println(perspectiveB.getLabel());
>
> stack.setSelectedElement(perspectiveB);
> }
>
> I didn't find a getWindows() method for MApplication.
>
> I'm using Build I20120315-1300. Do I have to download a different one?
>
> Fausto
>
>