Skip to main content

Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Eclipse 4 » "Abstract" Eclipse perspective to avoid redundant e4xmi
"Abstract" Eclipse perspective to avoid redundant e4xmi [message #1727225] Mon, 21 March 2016 12:30
Max Hohenegger is currently offline Max HoheneggerFriend
Messages: 11
Registered: April 2012
Junior Member

What is the best way to replace elements in the Eclipse e4 application model, depending on the active perspective?

The problem:
Most of the perspectives in my RCP application have a fairly similar layout, and include mostly the same parts. These perspectives are distributed over multiple fragment.e4xmi files in multiple plug-ins. Currently, each of them redundantly defines the layout, using PartSashContainers, PartStacks, and Placeholders for the parts. If I have to add a new perspective, I have to clone an existing one, without missing any detail. If I make changes, I usually have to make them in each clone.

Solution ?
I want to follow the DRY principle, so I set up a standard "root" PartSashContainer in my Application.e4xmi, containing the generic layout. I imported it in the fragment.e4xmi files, and then replaced the root control of each perspective with a PlaceHolder, pointing to the imported PartSashContainer.

Finally, I extended the PartStacks from my "abstract" perspective (Application.e4xmi), with model fragments, adding the perspective-specific parts.

Unfortunately for my users, this is not equivalent to what I had before because each fragment.e4xmi will add new elements, e.g. parts to a PartStack, but I need to replace them, depending on the active perspective. There are some other minor issues, but I can live with and/or work around them.
Previous Topic:Projects dissappears on Mars
Next Topic:Debugging Eclipse Welcome Page
Goto Forum:

Current Time: Sat Jun 25 12:23:19 GMT 2022

Powered by FUDForum. Page generated in 0.01335 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top