[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [Newsgroup Home]
[news.eclipse.tools.emf] Re: Create Child programmatically

Artur,

You could use CreateChildCommand and execute it on the command stack. Or just use an AddCommand directly (also executing it on the command stack).


Artur Kronenberg wrote:
Hi,

I have the following problem:

I created an EMF editor that is handeling a specific task in itself. As soon as the element is created (through mouseclicking) the editor synchronizes perfectly and everything works just fine.

The problem is, that I need the Child created programmatically by a right click on my gmf editor.

I have no problem getting the name for the child Element. I know I can create a child element with my FactoryImpl.createChildElement() and set the name on the returned object. But how can I add the element to the model of the EMF editor so it gets updated, undo is supported and so on..

basically I try to use the action that is give through the UI by rightclicking on a node, creating a child but only programmatically.

Is there a way to do that?
Best regards,
Artur