IUndoContext and Undo/Redo actions [message #234185] |
Fri, 19 June 2009 07:26 |
Javier Messages: 57 Registered: July 2009 |
Member |
|
|
Hello guys.
As far as I know, GMF commands implement the interface
IUndoableOperation, which includes the concept of IUndoContext. This
concept is also important in Undo/Redo action handlers, since we need to
tell those handlers which context to cover, it is, they will get from
the OperationHistory just those commands with the same UndoContext. At
least this is what I understand from what I read. Exactly as it says, if
I create a GMF command and I execute it this way:
DiagramEditor().getDiagramCommandStack().execute(command), that
DiagramCommandStack has a method to get the IUndoContext it is working with.
But then I find a problem with working with the
TransactionalEditingDomain.commandStack(). If I have an EMF command, and
I execute it this way:
editingDomain().getCommandStack().execute(command) I don't really know
which context it is operating under, since that CommandStack has no
UndoContext and EMF command have no UndoContext either. But when you are
working in the DigramaEditor and you execute a command this way, you do
get the possibility of Undoing that command from the edit menú. How is
this possible? Which undo context have those commands executed in the
TransactionalEditingDomain? I need to understand this because I'm trying
to make some modifications in the model when the diagram is closed and I
just have this EditingDomain CommandStack (not the DiagramCommandStack),
and I don't get to see my executed commands in the edit menú.
Does anyone have an idea about this? I would really appreciate any help..
Thank you!
|
|
|
|
Powered by
FUDForum. Page generated in 0.02429 seconds