Skip to main content



      Home
Home » Modeling » EMF » models referencing across editors (models referencing )
models referencing across editors [message #1117401] Thu, 26 September 2013 07:58 Go to next message
Eclipse UserFriend
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 08:50 Go to previous messageGo to next message
Eclipse UserFriend
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 05:02 Go to previous messageGo to next message
Eclipse UserFriend
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 08:32 Go to previous messageGo to next message
Eclipse UserFriend
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 14:48 Go to previous messageGo to next message
Eclipse UserFriend
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 01:58 Go to previous message
Eclipse UserFriend
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 04:12] by 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 Jul 01 14:15:30 EDT 2025

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

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

Back to the top