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: 26289
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.
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: 26289
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?
Previous Topic:[Texo] Problems handling ResponseType
Next Topic:[EMFStore] Is it somehow possible to use EMFStore for metamodels?
Goto Forum:
  


Current Time: Mon Dec 22 17:49:16 GMT 2014

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

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