Sadık
Sadık

Reputation: 4419

Build a Perspective from Fragment with Eclipse e4

Is it possible to define a perspective stack and perspective in the fragment.e4xmi? The Eclipse 4 model editor doesn't seem to allow it. Why?

I add a new Model Fragment and for Feature Name I click Find .... When I want to add a Perspective or a Perspective Stack, the dialog greys out the OK-Button.

Find Feature Name - OK Button greyed out

Also, I have a lack of understanding what this Dialog is showing in general. It lists certain UI Elements and a lot of items below them, like

and so on. But those are listed multiple times. For example children is listed under CompositePart and under Dialog. But it doesn't make any difference which one I chose.

It doesn't make a difference which children item is chosen.

I know I can define the Perspective in the plugin.xml using the extension point and implementing IPerspectiveFactory. Is there no way to do it with the fragment.e4xmi?

Upvotes: 0

Views: 372

Answers (2)

Tobias B.
Tobias B.

Reputation: 1

Even if the question is older, here is a current answer (since I was looking for that myself)

I understood this to mean that you want to add a perspective to an existing application through model fragment. as shown in the picture Model Fragment Definition Picture

Extended Element ID: Here you link the perspective stack from your main application -> so you can change the perspective later Extended Element-ID Picture

Feature Name: Here take children List<Perspective> from PerspectiveStack -> allows you to create perspectives as a child Feature Name Picture

and you're done...now set your dependencies and you can change the perspective via code :)

Upvotes: 0

greg-449
greg-449

Reputation: 111216

Not sure about that dialog as I don't usually use it.

What you want to add is a Model Fragment with the 'Extended Element-ID' set to the id of the TrimmedWindow you want to put the perspective in. The 'Feature Name' would be children.

The model editor should then let you add a "Perspective Stack" as a child.

You can add the Perspective to the stack.

Note: Using the plugin.xml and IPerspectiveFactory is for Eclipse 3.x compatability mode, not pure e4. If you are using compatability mode I'm not sure how defining a perspective in the model editor fits.

Upvotes: 0

Related Questions