Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » EMF "Technology" (Ecore Tools, EMFatic, etc)  » Adding/Editing/Deleting Ecore objects programmatically using EditingDomain(How? Any example?)
Adding/Editing/Deleting Ecore objects programmatically using EditingDomain [message #986016] Sat, 17 November 2012 14:00 Go to next message
Pradeep Badiger is currently offline Pradeep BadigerFriend
Messages: 53
Registered: November 2012
Member
Hi,

I am trying to add some annotations, fields and references to an EClass programmatically using EditingDomain. Do we have some examples?

thanks,
Pradeep V.B.
Re: Adding/Editing/Deleting Ecore objects programmatically using EditingDomain [message #986019 is a reply to message #986016] Sat, 17 November 2012 15:00 Go to previous messageGo to next message
Ed Merks is currently offline Ed MerksFriend
Messages: 33141
Registered: July 2009
Senior Member
You'd use things like AddCommand.create (see the Javadoc) and then use
editingDomain.getCommandStack().execute.

On 17/11/2012 3:00 PM, Pradeep Badiger wrote:
> Hi,
>
> I am trying to add some annotations, fields and references to an
> EClass programmatically using EditingDomain. Do we have some examples?
>
> thanks,
> Pradeep V.B.


Ed Merks
Professional Support: https://www.macromodeling.com/
Re: Adding/Editing/Deleting Ecore objects programmatically using EditingDomain [message #1001957 is a reply to message #986019] Thu, 17 January 2013 16:00 Go to previous messageGo to next message
Pradeep Badiger is currently offline Pradeep BadigerFriend
Messages: 53
Registered: November 2012
Member
Hi Ed,

I was able to create the required EMF features in the model, but the command stack doesnt allow me to save the changes. Is there anything that i have to set to make it save or ask user to save the file when modified programmatically?
Re: Adding/Editing/Deleting Ecore objects programmatically using EditingDomain [message #1002230 is a reply to message #1001957] Fri, 18 January 2013 08:11 Go to previous message
Ed Merks is currently offline Ed MerksFriend
Messages: 33141
Registered: July 2009
Senior Member
Pradeep,

You can look at the generated editor (or EcoreEditor) to see how things
are saved.

On 17/01/2013 5:00 PM, Pradeep Badiger wrote:
> Hi Ed,
>
> I was able to create the required EMF features in the model, but the
> command stack doesnt allow me to save the changes. Is there anything
> that i have to set to make it save or ask user to save the file when
> modified programmatically?


Ed Merks
Professional Support: https://www.macromodeling.com/
Previous Topic:[Texo] Problems handling ResponseType
Next Topic:[EMFStore] Is it somehow possible to use EMFStore for metamodels?
Goto Forum:
  


Current Time: Thu Apr 25 22:57:27 GMT 2024

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

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

Back to the top