Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Rich Client Platform (RCP) » Loading order of model fragments(I try to extend a model fragment with a fragment)
Loading order of model fragments [message #1159384] Mon, 28 October 2013 09:46 Go to next message
Peter Szaszvari is currently offline Peter Szaszvari
Messages: 5
Registered: October 2013
Junior Member
We are working on an e4 RCP project where many groups of developers are developing the same application. We cannot modify the Application.e4xmi. There are fragment.e4xmi-s given by others and we would like to extend the model at a point that is given by another fragment.
As far as I can see it is possible to extend a fragment with another fragment but the result depends on the order how the framework is parsing fragments. Depending on this order the extension will be successful or not. The order can not be influenced. It is not related to the loading order of the containing plugins. And this seems to be a problem.

Example:
I define perspective stack in a fragment. I try to define perspective and everything under it in another fragment. This second fragment refers to the perspective stack in the first segment. It will or will not work depending on the parsing order and I cannot predict the result.

Can anybody confirm my findings?
Can someone suggest a workaround?

Thank you.
Re: Loading order of model fragments [message #1185372 is a reply to message #1159384] Wed, 13 November 2013 21:41 Go to previous messageGo to next message
Tuan Anh Nguyen is currently offline Tuan Anh Nguyen
Messages: 7
Registered: June 2013
Junior Member
Hi Peter Szaszvari , i am also facing order problems now, i tried to contribute to a fragment from another fragment without success. Have you figured out how to fix this ?
Re: Loading order of model fragments [message #1186062 is a reply to message #1185372] Thu, 14 November 2013 07:59 Go to previous messageGo to next message
Peter Szaszvari is currently offline Peter Szaszvari
Messages: 5
Registered: October 2013
Junior Member
Hello, So far I only downloaded the source and read the code. As far as I can see, eclipse reads the model extensions and merges the fragments so, that only those nodes gets merged which already have parent. So the listing order of fragments is random, and if one refers to a fragment that is not loaded yet, then it will not be merged.

I am not ready yet, I still investigate the issue as I have time.
I will write up here what I find.

Good starting point is: org.eclipse.e4.ui.internal.workbench.ModelAssembler


Peter
Re: Loading order of model fragments [message #1192817 is a reply to message #1185372] Sun, 17 November 2013 14:47 Go to previous messageGo to next message
Peter Szaszvari is currently offline Peter Szaszvari
Messages: 5
Registered: October 2013
Junior Member
Finally solution seems to be easy...

Model extensions are sorted according to plugin dependency. So if Fragment2 is in Plugin2 and it wants to contribute to Fragment1 in Plugin1 then Plugin2 should list Plugin1 as dependency.
I just tried it with an application and two plugins with fragments referring to each other. Loading order reflected plugin dependency.
Re: Loading order of model fragments [message #1213511 is a reply to message #1192817] Wed, 27 November 2013 04:15 Go to previous message
Tuan Anh Nguyen is currently offline Tuan Anh Nguyen
Messages: 7
Registered: June 2013
Junior Member
Hi, yeah that's the current solution now! Thanks for your help, especially the starting point class Smile
But i still think this solution have some problem. In my situation, we have a plugin,which make contribution via model fragment, that contribute to 2 different fragment and these 2 fragment belong to different application. So with this solution, 2 applications must use each other's plugin.
Ex:
Application A with plugin Hello contribute a model fragment
Applicaton B with plugin Hi contribute a model fragment

Plugin XYX contribute a model fragment to both Hello and Hi's model fragments, so the plugin XYZ must add dependency to both plugin Hello and Hi. It means Application A and B must add dependency to each other's plugin. This will lead to a complex situation if plugin Hello and Hi have many other dependencies .

[Updated on: Wed, 27 November 2013 04:27]

Report message to a moderator

Previous Topic:Design/Architectual question perspective | views
Next Topic:Creating Eclipse RCP Toolbar With Action
Goto Forum:
  


Current Time: Mon Jul 28 06:19:42 EDT 2014

Powered by FUDForum. Page generated in 0.01576 seconds