Undo Operation on Editing domain's command stack [message #557601] |
Wed, 08 September 2010 09:16 |
manasa Messages: 3 Registered: September 2010 |
Junior Member |
|
|
Hi,
I am a novice in EMF, and have a question regarding the undo operation on ediitng domain.
I see that calling an undo on the editing domain, i.e
EditingDomain.getCommandStack().undo(), internally calls an undo implementation (in this case, undo() in BasicCommandStack) , where only the topmost command of the commandstack is reverted back.
I was expecting the undo call on the editing domain, to undo all the commands in the command stack, but this is not the case.
Is there a way, how all the commands in the command stack could be reverted back at once?
Thanks,
Manasa
|
|
|
Re: Undo Operation on Editing domain's command stack [message #557693 is a reply to message #557601] |
Wed, 08 September 2010 14:14 |
Ed Merks Messages: 33218 Registered: July 2009 |
Senior Member |
|
|
Manasa,
Comments below.
manasa wrote:
> Hi,
>
> I am a novice in EMF, and have a question regarding the undo operation
> on ediitng domain.
>
> I see that calling an undo on the editing domain, i.e
> EditingDomain.getCommandStack().undo(), internally calls an undo
> implementation (in this case, undo() in BasicCommandStack) , where
> only the topmost command of the commandstack is reverted back.
Yes, as the Javadoc says.
>
> I was expecting the undo call on the editing domain, to undo all the
> commands in the command stack, but this is not the case.
It would be hard to implement undo in the editor if that's the only
thing the command stack supported. How would one undo just one command
and have the command stack be updated to redo that command?
>
> Is there a way, how all the commands in the command stack could be
> reverted back at once?
You'd have to call undo repeatedly until the command stack can't be
undone anymore.
>
> Thanks,
> Manasa
Ed Merks
Professional Support: https://www.macromodeling.com/
|
|
|
|
Powered by
FUDForum. Page generated in 0.04143 seconds