Fragments and model elements merging [message #1067778] |
Wed, 10 July 2013 14:29 |
Pierre GAUTIER Messages: 13 Registered: August 2010 |
Junior Member |
|
|
Hi,
I've struggling with a fragment issue for some time and just found a post that seems related to my problem.
http://www.eclipse.org/forums/index.php/t/458845/
I'd like to be sure to understand well.
Let's say I've 2 plugins A & B, both optional to my application.
If both of them are present I'd like them to add a part in the same part stack. If only one of them is present I want the part stack created with the part, if none I don't want the stack created at all.
What would be the good way to achieve that ?
If I create the stack in only one plugin, obviously it won't work : if it's not present the stack wouldn't be either.
But if I create the stack in both plugin it seems that they are not merged.
Is it the normal comportment ? Should I use a processor to use that ? Wouldn't be better that to be the default comportment ?
Thanks by advance,
Pierre GAUTIER
[Updated on: Wed, 10 July 2013 14:39] Report message to a moderator
|
|
|
Re: Fragments and model elements merging [message #1067838 is a reply to message #1067778] |
Wed, 10 July 2013 19:30 |
Mateusz Malinowski Messages: 36 Registered: March 2013 Location: Bristol |
Member |
|
|
Hi,
If you don't care about persistance of the perspective which contains this part stack, you may create two processors (I'm afraid you can't avoid it).
1) the first processor will run before fragments and will simply remove all children of your part stack,
2) the second processor will run after fragments are merged and will set selected part, for example, the the first child, so you won't have any exceptions.
Now to test that, you can shift dependencies in your .product file, but if you read more about p2, you may find a way to pick plugins at the start-up of you application (when you export it to a stand-alone program).
This is the fastest solution I could think of.
|
|
|
|
Powered by
FUDForum. Page generated in 0.03856 seconds