Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » MoDisco » edit generated java model
edit generated java model [message #989622] Thu, 06 December 2012 20:25 Go to next message
Emiliano Galitiello is currently offline Emiliano Galitiello
Messages: 2
Registered: December 2012
Junior Member
Hello
First I'm sorry if this question has been posted before, I read the previous questions and none seems to fit my question.
We need to edit the generated model, for example, change the type on a field declaration.
As there are model, edit and editor plugins for emf models, we wonder what is the needed plugin to edit the java model.
If there is not such plugin, what is the better way to edit the generated model?
Thanks a lot in advance for your time.
Re: edit generated java model [message #989659 is a reply to message #989622] Fri, 07 December 2012 03:33 Go to previous messageGo to next message
Andreas Brieg is currently offline Andreas Brieg
Messages: 48
Registered: November 2012
Member
For editing single elements of an ecore model instance, you can use the sample reflective model editor. To open this editor, select your generated model file -> right click -> open with -> sample reflective model editor. If you need to apply the same change many times, you should have a look at ATL.
Re: edit generated java model [message #989670 is a reply to message #989659] Fri, 07 December 2012 04:15 Go to previous messageGo to next message
Hugo Bruneliere is currently offline Hugo Bruneliere
Messages: 603
Registered: July 2009
Senior Member
Hello,

As useful complementary information: MoDisco provides the generic MoDisco Model Browser, which is particularly dedicated to the navigation through large & complex models (such as the Java ones you can obtain using the MoDisco Java Model Discoverer).
Actually, if you have MoDisco installed (which is the case I guess as you are talking about Java models), this should be the default editor for EMF models (i.e. XMI files).
In addition to all the proposed advanced navigation features, it also provides the main base editing capabilities that you will find in the EMF sample reflective model editor.
I encourage you to take a deeper look into the MoDisco Reference Documentation to get more details on this component.

Best regards,

Hugo


------------------------------------------
Hugo Bruneliere - R&D Engineer
AtlanMod research team (Inria, EMN & LINA)
Ecole des Mines de Nantes
Nantes - France
------------------------------------------
Re: edit generated java model [message #989828 is a reply to message #989622] Fri, 07 December 2012 23:35 Go to previous messageGo to next message
Emiliano Galitiello is currently offline Emiliano Galitiello
Messages: 2
Registered: December 2012
Junior Member
Andreas, Hugo: Thanks for your quick response and help.
Maybe I was not clear enough. We need to edit a java model programatically. We generate the model programatically (using modisco), and then we need to change some properties of the objects in this model (i.e. a type in a field declaration). Since that, in an EMF model, is done via the edit plugin, we were wondering what is the best way to do it in Modisco
Thanks in advance!
Re: edit generated java model [message #989962 is a reply to message #989828] Mon, 10 December 2012 04:36 Go to previous message
Hugo Bruneliere is currently offline Hugo Bruneliere
Messages: 603
Registered: July 2009
Senior Member
Hello,

Independently from MoDisco and as for any EMF model, you have two main ways of handling your Java model programmatically:

  1. Use the API automatically generated from the Java metamodel in Ecore (provided in this case by the org.eclipse.gmt.modisco.java plugin);
  2. Use the EMF reflective (dynamic) API (cf. this article for instance).

I hope this help.

Best regards,

Hugo


------------------------------------------
Hugo Bruneliere - R&D Engineer
AtlanMod research team (Inria, EMN & LINA)
Ecole des Mines de Nantes
Nantes - France
------------------------------------------
Previous Topic:MoDisco already supports SMM (structured metrics metamodel) ?
Next Topic:How to return multiple results for query on ecore model
Goto Forum:
  


Current Time: Thu Aug 28 01:17:09 EDT 2014

Powered by FUDForum. Page generated in 0.10618 seconds