Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » EMF "Technology" (Ecore Tools, EMFatic, etc)  » Create two behaviours to add an element in an EMF editor
Create two behaviours to add an element in an EMF editor [message #106063] Fri, 04 January 2008 14:43 Go to next message
Eclipse UserFriend
Originally posted by: marion.di-giacomo.cea.fr

Hi,

I have a problem with the creation of my elements in my EMF editor.
When I create an element, I would like to create two children.
So I modified the 'create' method in the factory class and called the
'create' methods of the two children.
But when I open a file which has already an element with its two children,
there are more than two created elements (the loaded elements and the
elements created in the factory class).
I would like to know how I can modify the behaviour of my editor in order
to have the two loaded elements when I open the editor, and two
default children when I create a new element. Maybe should I modify the
action of the menu bar ? I find an easy way to do it.

Thanks,

Marion
Re: Create two behaviours to add an element in an EMF editor [message #106212 is a reply to message #106063] Fri, 04 January 2008 19:22 Go to previous message
Eclipse UserFriend
Originally posted by: merks.ca.ibm.com

Marion,

Next time you should ask EMF questions on the EMF newsgroup.
news://news.eclipse.org/eclipse.tools.emf

You can specialize the wizard itself so that when you create a new
object in createInitialModel you create one with additional children.
In terms of create commands within the editor, you can specialize the
collectNewChildDescriptors method in the XyzItemProvider to create new
instances that have children or have other features already set on them;
you don't need to use commands for doing that prepopulation.


Marion Di Giacomo wrote:
> Hi,
>
> I have a problem with the creation of my elements in my EMF editor.
> When I create an element, I would like to create two children.
> So I modified the 'create' method in the factory class and called the
> 'create' methods of the two children. But when I open a file which has
> already an element with its two children, there are more than two
> created elements (the loaded elements and the elements created in the
> factory class).
> I would like to know how I can modify the behaviour of my editor in
> order to have the two loaded elements when I open the editor, and
> two default children when I create a new element. Maybe should I
> modify the action of the menu bar ? I find an easy way to do it.
> Thanks,
>
> Marion
>
Re: Create two behaviours to add an element in an EMF editor [message #613923 is a reply to message #106063] Fri, 04 January 2008 19:22 Go to previous message
Ed Merks is currently offline Ed MerksFriend
Messages: 33140
Registered: July 2009
Senior Member
Marion,

Next time you should ask EMF questions on the EMF newsgroup.
news://news.eclipse.org/eclipse.tools.emf

You can specialize the wizard itself so that when you create a new
object in createInitialModel you create one with additional children.
In terms of create commands within the editor, you can specialize the
collectNewChildDescriptors method in the XyzItemProvider to create new
instances that have children or have other features already set on them;
you don't need to use commands for doing that prepopulation.


Marion Di Giacomo wrote:
> Hi,
>
> I have a problem with the creation of my elements in my EMF editor.
> When I create an element, I would like to create two children.
> So I modified the 'create' method in the factory class and called the
> 'create' methods of the two children. But when I open a file which has
> already an element with its two children, there are more than two
> created elements (the loaded elements and the elements created in the
> factory class).
> I would like to know how I can modify the behaviour of my editor in
> order to have the two loaded elements when I open the editor, and
> two default children when I create a new element. Maybe should I
> modify the action of the menu bar ? I find an easy way to do it.
> Thanks,
>
> Marion
>


Ed Merks
Professional Support: https://www.macromodeling.com/
Previous Topic:[CDO][0.8.0] Problem with OutOfMemory
Next Topic:[CDO][0.8.0] CDORevision List - should have a better implementation for UNINITIALIZED data.
Goto Forum:
  


Current Time: Wed Apr 24 23:54:26 GMT 2024

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

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

Back to the top