Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » Epsilon » Merging two instances of a model in one graphical editor
Merging two instances of a model in one graphical editor [message #730072] Tue, 27 September 2011 10:59 Go to next message
Eclipse User is currently offline Eclipse User
Messages: 257
Registered: July 2009
Senior Member
Hi

This is a high level question:

I have an GMF based editor created using the GMF Tooling. It can handle
one model but I would like to "import"? or "merge"? two models of the
same type in one instance of the graphical editor. Is there already a
way using Epsilon to achieve this and if so how? If there is no
prescribed way then any suggestions that i can try?

-H
Re: Merging two instances of a model in one graphical editor [message #730074 is a reply to message #730072] Tue, 27 September 2011 11:12 Go to previous messageGo to next message
Antonio Garcia-Dominguez is currently offline Antonio Garcia-Dominguez
Messages: 304
Registered: January 2010
Senior Member
Could you elaborate further on what a "merge" means to you?

If you need to match elements from two models in order to produce a new model, perhaps you should have a look at the Epsilon Merging Language (EML). You can find more information about it in Epsilon's website:

http://eclipse.org/gmt/epsilon/doc/eml/

However, this would produce a new model and you'd need to load it into a separate editor view, I believe.

Or, perhaps you'd like to import the contents of the other model as-is into your diagram? That's quite a bit more difficult, I think.
Re: Merging two instances of a model in one graphical editor [message #730095 is a reply to message #730074] Tue, 27 September 2011 11:26 Go to previous messageGo to next message
Eclipse User is currently offline Eclipse User
Messages: 257
Registered: July 2009
Senior Member
On 09/27/2011 05:12 PM, Antonio Garcia-Dominguez wrote:
> Could you elaborate further on what a "merge" means to you?

merge for now means combining two models into a new model.

>
> If you need to match elements from two models in order to produce a new
> model, perhaps you should have a look at the Epsilon Merging Language
> (EML). You can find more information about it in Epsilon's website:
>
> http://eclipse.org/gmt/epsilon/doc/eml/
>
> However, this would produce a new model and you'd need to load it into a
> separate editor view, I believe.

Yeah... I was thinking so too... haven't read the docs yet for it but
this might work with some kind of new wizard BUT then... how would you
combine an additional model to the result of the first merge and
represent it graphically? Would this mean having to open a new instance
fo the the graphical editor and discard the old OR will the graphical
editor be able to refresh itself with the new model???

>
> Or, perhaps you'd like to import the contents of the other model as-is
> into your diagram? That's quite a bit more difficult, I think.
>

Yeah... the Ecore tools graphical editor kind of has this functionality
with thier two step "Load Resrouce" + "Create Shortcut" process. This
is another experiment... look how they do it and implementing in my
editor maybe??

I would like the user to be able to select which models to combine from
the available models in the workspace and be presented with a graphical
editor that contain all the elements of the selected models.

-H
Re: Merging two instances of a model in one graphical editor [message #730182 is a reply to message #730095] Tue, 27 September 2011 15:42 Go to previous message
Antonio Garcia-Dominguez is currently offline Antonio Garcia-Dominguez
Messages: 304
Registered: January 2010
Senior Member
Eclipse User wrote on Tue, 27 September 2011 11:26

Yeah... I was thinking so too... haven't read the docs yet for it but
this might work with some kind of new wizard BUT then... how would you
combine an additional model to the result of the first merge and
represent it graphically? Would this mean having to open a new instance
fo the the graphical editor and discard the old OR will the graphical
editor be able to refresh itself with the new model???


If you generate a new model file, you'll have to open a new editor. If you add the elements from the other model into the model being edited, I guess you won't have to do that.

Eclipse User wrote on Tue, 27 September 2011 11:26

Yeah... the Ecore tools graphical editor kind of has this functionality
with thier two step "Load Resrouce" + "Create Shortcut" process. This
is another experiment... look how they do it and implementing in my
editor maybe??


That's more like splitting a model over several files, rather than merging two models together.

Eclipse User wrote on Tue, 27 September 2011 11:26

I would like the user to be able to select which models to combine from
the available models in the workspace and be presented with a graphical
editor that contain all the elements of the selected models.


You'll probably have to write custom code to do that. I think the safest bet would be to call EML programmatically to produce a new model and then open it automatically in a new editor view. I don't think EML is designed to allow in-place merging (i.e. having one of the source models and the output model be the same). However, I haven't worked on that part of Epsilon, so I'm not 100% sure.
Previous Topic:Eugenia errors ManagerVisualIDRegistry
Next Topic:Eugenia return boolean problem
Goto Forum:
  


Current Time: Sun Aug 31 06:28:06 EDT 2014

Powered by FUDForum. Page generated in 0.04483 seconds