Skip to main content



      Home
Home » Modeling » GMF (Graphical Modeling Framework) » Avoiding double Undo operation when mixing GEF and EMF commands.
Avoiding double Undo operation when mixing GEF and EMF commands. [message #129791] Fri, 25 May 2007 03:43 Go to next message
Eclipse UserFriend
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 Go to previous message
Eclipse UserFriend
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.
Previous Topic:Copy and paste post processing
Next Topic:Resize automatically a Rectangle
Goto Forum:
  


Current Time: Mon Sep 15 17:11:23 EDT 2025

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

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

Back to the top