Skip to main content



      Home
Home » Modeling » UML2 » EMF.edit commands usage
EMF.edit commands usage [message #473772] Thu, 05 July 2007 22:47 Go to next message
Eclipse UserFriend
Hello,

I have a few things not very clear about the edit commands.

I'm using an AdapterFactoryEditingDomain with commands in a
BasicCommandStack. I tested successfully the ChangeCommand (it modifies the
model and undo/redo works).

Is there a reason I should use SetCommand, or AddCommand or other commands?
I could make the same "set" and "add" with model changes inside a ChangeCommand.
What is the difference between the two approaches?

Thanks

Bogdan Pistol,
Re: EMF.edit commands usage [message #473875 is a reply to message #473772] Fri, 06 July 2007 07:58 Go to previous messageGo to next message
Eclipse UserFriend
Bogdan,

These are more EMF-specific questions that are best asked on the EMF
newsgroup, which I've added to the "to" list of the reply. The use of
specific commands like SetCommand and AddCommand allow the item
providers that create these commands to specialize the behavior. For
example, for an EObject X, when I set feature foo, I might want to also
update some other feature goo. By specializing createSetCommand in
XItemProvider, I could do that. The ChangeCommand is very handy if you
just want to do a bunch of direct model manipulations, or need to invoke
some utility methods that knows= nothing about commands, but still want
any changes being made to be undoable.


Bogdan Pistol wrote:
> Hello,
>
> I have a few things not very clear about the edit commands.
>
> I'm using an AdapterFactoryEditingDomain with commands in a
> BasicCommandStack. I tested successfully the ChangeCommand (it modifies the
> model and undo/redo works).
>
> Is there a reason I should use SetCommand, or AddCommand or other commands?
> I could make the same "set" and "add" with model changes inside a ChangeCommand.
> What is the difference between the two approaches?
>
> Thanks
>
> Bogdan Pistol,
>
Re: EMF.edit commands usage [message #473883 is a reply to message #473875] Fri, 06 July 2007 13:05 Go to previous message
Eclipse UserFriend
Thank you Ed

Bogdan,

On Fri, 06 Jul 2007 07:58:27 -0400, Ed Merks wrote:

> Bogdan,
>
> These are more EMF-specific questions that are best asked on the EMF
> newsgroup, which I've added to the "to" list of the reply. The use of
> specific commands like SetCommand and AddCommand allow the item
> providers that create these commands to specialize the behavior. For
> example, for an EObject X, when I set feature foo, I might want to also
> update some other feature goo. By specializing createSetCommand in
> XItemProvider, I could do that. The ChangeCommand is very handy if you
> just want to do a bunch of direct model manipulations, or need to invoke
> some utility methods that knows= nothing about commands, but still want
> any changes being made to be undoable.
>
>
> Bogdan Pistol wrote:
>> Hello,
>>
>> I have a few things not very clear about the edit commands.
>>
>> I'm using an AdapterFactoryEditingDomain with commands in a
>> BasicCommandStack. I tested successfully the ChangeCommand (it modifies the
>> model and undo/redo works).
>>
>> Is there a reason I should use SetCommand, or AddCommand or other commands?
>> I could make the same "set" and "add" with model changes inside a ChangeCommand.
>> What is the difference between the two approaches?
>>
>> Thanks
>>
>> Bogdan Pistol,
>>
Re: EMF.edit commands usage [message #622850 is a reply to message #473772] Fri, 06 July 2007 07:58 Go to previous message
Eclipse UserFriend
Bogdan,

These are more EMF-specific questions that are best asked on the EMF
newsgroup, which I've added to the "to" list of the reply. The use of
specific commands like SetCommand and AddCommand allow the item
providers that create these commands to specialize the behavior. For
example, for an EObject X, when I set feature foo, I might want to also
update some other feature goo. By specializing createSetCommand in
XItemProvider, I could do that. The ChangeCommand is very handy if you
just want to do a bunch of direct model manipulations, or need to invoke
some utility methods that knows= nothing about commands, but still want
any changes being made to be undoable.


Bogdan Pistol wrote:
> Hello,
>
> I have a few things not very clear about the edit commands.
>
> I'm using an AdapterFactoryEditingDomain with commands in a
> BasicCommandStack. I tested successfully the ChangeCommand (it modifies the
> model and undo/redo works).
>
> Is there a reason I should use SetCommand, or AddCommand or other commands?
> I could make the same "set" and "add" with model changes inside a ChangeCommand.
> What is the difference between the two approaches?
>
> Thanks
>
> Bogdan Pistol,
>
Re: EMF.edit commands usage [message #623293 is a reply to message #473875] Fri, 06 July 2007 13:05 Go to previous message
Eclipse UserFriend
Thank you Ed

Bogdan,

On Fri, 06 Jul 2007 07:58:27 -0400, Ed Merks wrote:

> Bogdan,
>
> These are more EMF-specific questions that are best asked on the EMF
> newsgroup, which I've added to the "to" list of the reply. The use of
> specific commands like SetCommand and AddCommand allow the item
> providers that create these commands to specialize the behavior. For
> example, for an EObject X, when I set feature foo, I might want to also
> update some other feature goo. By specializing createSetCommand in
> XItemProvider, I could do that. The ChangeCommand is very handy if you
> just want to do a bunch of direct model manipulations, or need to invoke
> some utility methods that knows= nothing about commands, but still want
> any changes being made to be undoable.
>
>
> Bogdan Pistol wrote:
>> Hello,
>>
>> I have a few things not very clear about the edit commands.
>>
>> I'm using an AdapterFactoryEditingDomain with commands in a
>> BasicCommandStack. I tested successfully the ChangeCommand (it modifies the
>> model and undo/redo works).
>>
>> Is there a reason I should use SetCommand, or AddCommand or other commands?
>> I could make the same "set" and "add" with model changes inside a ChangeCommand.
>> What is the difference between the two approaches?
>>
>> Thanks
>>
>> Bogdan Pistol,
>>
Previous Topic:Java Problems
Next Topic:How to add an interface into to list of providedinterfaces of Port?
Goto Forum:
  


Current Time: Sun Jul 27 01:58:36 EDT 2025

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

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

Back to the top