Avoiding double Undo operation when mixing GEF and EMF commands. [message #129791] |
Fri, 25 May 2007 03:43  |
Eclipse User |
|
|
|
Hi, I'm creating a CompoundCommand returned in the
getResizeChildrenCommand() method of a
XYLayoutEditPolicy. I'm altering the model >inside< a Command added to the
compound via an EMF RecordingCommand. The problem? This results, somehow,
in two
undoable operations (An that makes sense). I really need only ONE undo
operation for this.
I've tried to find a wrapper for an EMF RecordingCommand to handle this
nicely inside the GEF stack...
And I've found none.
Right now I'm directly executing the RecordingComand via
getEditingDomain().getCommandStack().execute(),
inside the GEF Command that does not look good and does not work right.
Any idea? Thanks.
|
|
|
Re: Avoiding double Undo operation when mixing GEF and EMF commands. [message #131687 is a reply to message #129791] |
Thu, 31 May 2007 15:41  |
Eclipse User |
|
|
|
Originally posted by: cdamus.ca.ibm.com
Hi, Richy,
I think your GEF CompoundCommand execution is being delegated to the
IOperationHistory, right? In that case, you should probably use an
AbstractTransactionalCommand instead of a RecordingCommand for your EMF
changes. Invoking execute() on the AbstractTransactionalCommand "directly"
will execute it not in any command-stack context.
You can use a CommandProxy, I think, to wrap the
AbstractTransactionalCommand in a GEF command.
HTH,
Christian
Richy wrote:
> Hi, I'm creating a CompoundCommand returned in the
> getResizeChildrenCommand() method of a
> XYLayoutEditPolicy. I'm altering the model >inside< a Command added to the
> compound via an EMF RecordingCommand. The problem? This results, somehow,
> in two
> undoable operations (An that makes sense). I really need only ONE undo
> operation for this.
>
> I've tried to find a wrapper for an EMF RecordingCommand to handle this
> nicely inside the GEF stack...
> And I've found none.
>
> Right now I'm directly executing the RecordingComand via
> getEditingDomain().getCommandStack().execute(),
> inside the GEF Command that does not look good and does not work right.
>
> Any idea? Thanks.
|
|
|
Powered by
FUDForum. Page generated in 0.03652 seconds