Eclipse Community Forums - RDF feed
https://www.eclipse.org/forums/
Eclipse Community ForumsMerging two instances of a model in one graphical editor
https://www.eclipse.org/forums/index.php/mv/msg/242817/730072/#msg_730072
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]]>Hugo A. Garcia2011-09-27T14:59:35-00:00Re: Merging two instances of a model in one graphical editor
https://www.eclipse.org/forums/index.php/mv/msg/242817/730074/#msg_730074
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:
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.
]]>Antonio Garcia-Dominguez2011-09-27T15:12:41-00:00Re: Merging two instances of a model in one graphical editor
https://www.eclipse.org/forums/index.php/mv/msg/242817/730095/#msg_730095
> 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]]>Hugo A. Garcia2011-09-27T15:26:52-00:00Re: Merging two instances of a model in one graphical editor
https://www.eclipse.org/forums/index.php/mv/msg/242817/730182/#msg_730182
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.
]]>Antonio Garcia-Dominguez2011-09-27T19:42:40-00:00