Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » MDT (Model Development Tools) » emf creation command ?
emf creation command ? [message #380002] Wed, 11 March 2009 16:00 Go to next message
Sorin Fagateanu is currently offline Sorin FagateanuFriend
Messages: 46
Registered: July 2009
Member
Hello,

I have a problem finding an emf command for creating/instancing an object.

For example setting a property of an object I do it by using the
SetCommand like this:

1.org.eclipse.uml2.uml.Class myClass = UMLFactory.eINSTANCE.createClass();

2.SetCommand.create(domain, myClass,
UMLPackage.eINSTANCE.getNamedElement_Name(), "TheName");

Are there such thing as a "CreateCommand" ?

My scope is to make a command that creates a Class within a Package,the
command to be undoable, and composed of basic emf commands.


Thanks in advance,
Sorin.
Re: emf creation command ? [message #380003 is a reply to message #380002] Wed, 11 March 2009 17:12 Go to previous messageGo to next message
Ed Merks is currently offline Ed MerksFriend
Messages: 33137
Registered: July 2009
Senior Member
Sorin,

Doesn't the basic UML2 editor do exactly that? It uses a
CreateChildCommand for that.


Sorin Fagateanu wrote:
> Hello,
>
> I have a problem finding an emf command for creating/instancing an
> object.
>
> For example setting a property of an object I do it by using the
> SetCommand like this:
>
> 1.org.eclipse.uml2.uml.Class myClass =
> UMLFactory.eINSTANCE.createClass();
>
> 2.SetCommand.create(domain, myClass,
> UMLPackage.eINSTANCE.getNamedElement_Name(), "TheName");
>
> Are there such thing as a "CreateCommand" ?
> My scope is to make a command that creates a Class within a
> Package,the command to be undoable, and composed of basic emf commands.
>
>
> Thanks in advance,
> Sorin.
>
>


Ed Merks
Professional Support: https://www.macromodeling.com/
Re: emf creation command ? [message #380004 is a reply to message #380003] Thu, 12 March 2009 07:28 Go to previous message
Sorin Fagateanu is currently offline Sorin FagateanuFriend
Messages: 46
Registered: July 2009
Member
I understand. Thank you for your prompt response !
Re: emf creation command ? [message #597495 is a reply to message #380002] Wed, 11 March 2009 17:12 Go to previous message
Ed Merks is currently offline Ed MerksFriend
Messages: 33137
Registered: July 2009
Senior Member
Sorin,

Doesn't the basic UML2 editor do exactly that? It uses a
CreateChildCommand for that.


Sorin Fagateanu wrote:
> Hello,
>
> I have a problem finding an emf command for creating/instancing an
> object.
>
> For example setting a property of an object I do it by using the
> SetCommand like this:
>
> 1.org.eclipse.uml2.uml.Class myClass =
> UMLFactory.eINSTANCE.createClass();
>
> 2.SetCommand.create(domain, myClass,
> UMLPackage.eINSTANCE.getNamedElement_Name(), "TheName");
>
> Are there such thing as a "CreateCommand" ?
> My scope is to make a command that creates a Class within a
> Package,the command to be undoable, and composed of basic emf commands.
>
>
> Thanks in advance,
> Sorin.
>
>


Ed Merks
Professional Support: https://www.macromodeling.com/
Re: emf creation command ? [message #597505 is a reply to message #380003] Thu, 12 March 2009 07:28 Go to previous message
Sorin Fagateanu is currently offline Sorin FagateanuFriend
Messages: 46
Registered: July 2009
Member
I understand. Thank you for your prompt response !
Previous Topic:emf creation command ?
Next Topic:emf basic undoable command for stereotypes?
Goto Forum:
  


Current Time: Fri Apr 19 10:38:52 GMT 2024

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

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

Back to the top