Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » EMF » models referencing across editors (models referencing )
models referencing across editors [message #1117401] Thu, 26 September 2013 11:58 Go to next message
Salwa Alzahmi is currently offline Salwa Alzahmi
Messages: 22
Registered: June 2013
Junior Member
Hello,


I am kind of looking for a proper way to model this case.

I have like 4 generated editors for each ecore model that I created. "modela.a , modelb.b, modelc.c, modeld.d". However, there is a kind of references between the models, forexample : modela.a have elements called 'Node' which referencing elements Tree in model.B.
How when I am opening the editor of modela.a, I can retrieve the needed elements from modelb.b at the design time.

the only thing that I can think of is loading the other models as a resources in the editor.. Please do correct me if this is not a correct approach ..

Re: models referencing across editors [message #1117441 is a reply to message #1117401] Thu, 26 September 2013 12:50 Go to previous messageGo to next message
Felix Dorner is currently offline Felix Dorner
Messages: 261
Registered: March 2012
Senior Member
On 26/09/2013 13:58, Salwa Alzahmi wrote:
> Hello,
>
> I am kind of looking for a proper way to model this case.
>
> I have like 4 generated editors for each ecore model that I created.
> "modela.a , modelb.b, modelc.c, modeld.d". However, there is a kind of
> references between the models, forexample : modela.a have elements
> called 'Node' which referencing elements Tree in model.B.
> How when I am opening the editor of modela.a, I can retrieve the needed
> elements from modelb.b at the design time.
> the only thing that I can think of is loading the other models as a
> resources in the editor.. Please do correct me if this is not a correct
> approach ..
>

Yes this is how it's done. But note that you can't have all 4 editors
open and modify around there.. Each editor has (by default) its own
"copy" of the underlying resources.
Re: models referencing across editors [message #1221286 is a reply to message #1117441] Tue, 17 December 2013 10:02 Go to previous messageGo to next message
Salwa Alzahmi is currently offline Salwa Alzahmi
Messages: 22
Registered: June 2013
Junior Member
Hi Flex,

Quit long to get to this again..
Can you please point me to what EMF API that I can used to load the resources programmatically?
That is , if I open Model A , model B will be loaded automatically with the opening of Model A Editor..



Re: models referencing across editors [message #1221345 is a reply to message #1221286] Tue, 17 December 2013 13:32 Go to previous messageGo to next message
Salwa Alzahmi is currently offline Salwa Alzahmi
Messages: 22
Registered: June 2013
Junior Member
ok I just added this code to my editor :
editingDomain.getResourceSet().getResource(URI.createURI("other model directory "), true);

However, is there is a way to load it without showing it in the editor .
please check attachment

salwa
Re: models referencing across editors [message #1222157 is a reply to message #1221345] Thu, 19 December 2013 19:48 Go to previous messageGo to next message
Ed Merks is currently offline Ed Merks
Messages: 26130
Registered: July 2009
Senior Member
Salwa,

What shows in the editor depends on the setInput for the view. If you
set the resource set as the input (what the generated edtitor does by
default), ResourceSetItemProvider will show all resources. Do you just
want to show one resource? Perhaps set the resource set's first
resource as the viewer's input.

On 17/12/2013 2:32 PM, Salwa Alzahmi wrote:
> ok I just added this code to my editor :
> editingDomain.getResourceSet().getResource(URI.createURI("other model directory "), true);
>
> However, is there is a way to load it without showing it in the editor .
> please check attachment
>
> salwa
Re: models referencing across editors [message #1222328 is a reply to message #1222157] Fri, 20 December 2013 06:58 Go to previous message
Salwa Alzahmi is currently offline Salwa Alzahmi
Messages: 22
Registered: June 2013
Junior Member
Thankx Ed for the reply ,


WEll, I tried this at the beginning , but it seems the property views always read from the viewer input , so only the elements from the resources set that I picked will be shown and it is not what I want ..
SO what I did , I set the input to the viewer to the whole resource set (my three model) , and then I setup a viewer filter to show only the resource set that I am interest in... the property view at the same time will keep showing the elements from the three models.

The only problem I have now , is when ever I update one model "add new elements" in its own editor , the other models can't see the new changes
any suggestion !!??

thanks
Salwa

[Updated on: Fri, 20 December 2013 09:12]

Report message to a moderator

Previous Topic:XML output unformatted with ecore:mixed
Next Topic:Access EMF Model from Resources of Deployed plugin- "Not workspace"
Goto Forum:
  


Current Time: Tue Oct 21 18:35:05 GMT 2014

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

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