public class CompareCommandStack extends DelegatingCommandStack implements ICompareCommandStack, IDisposable
ICompareCommandStack that delegate execution to another command stack but keep
informations about execution to properly reply to ICompareCommandStack protocol.
This implementation is not robust. If an error occurs during execution of a command, the whole state will be corrupted and the undo/redo may have an unknown behavior.
| Modifier and Type | Class and Description |
|---|---|
static class |
CompareCommandStack.CompareSideCommandStack
Simple data structure acting like a command stack but without any execution capability.
|
| Constructor and Description |
|---|
CompareCommandStack(CommandStack commandStack)
Creates a new instance that delegates to the given
commandStack. |
| Modifier and Type | Method and Description |
|---|---|
protected CommandStack |
delegate()
Returns the backing delegate instance that methods are forwarded to.
|
void |
dispose() |
void |
execute(Command command) |
void |
flush() |
boolean |
isLeftSaveNeeded()
Returns whether the left model has changes since
ICompareCommandStack.leftSaveIsDone() was call the last. |
boolean |
isRightSaveNeeded()
Returns whether the right model has changes since
ICompareCommandStack.rightSaveIsDone() was call the last. |
void |
leftSaveIsDone()
Called after a save of the left model has been successfully performed.
|
void |
redo() |
void |
rightSaveIsDone()
Called after a save of the right model has been successfully performed.
|
void |
undo() |
addCommandStackListener, canRedo, canUndo, getMostRecentCommand, getRedoCommand, getUndoCommand, notifyListeners, removeCommandStackListenerclone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitaddCommandStackListener, canRedo, canUndo, getMostRecentCommand, getRedoCommand, getUndoCommand, removeCommandStackListenerpublic CompareCommandStack(CommandStack commandStack)
commandStack.commandStack - the command stack to which this instance will delegate.public void dispose()
dispose in interface IDisposableIDisposable.dispose()protected CommandStack delegate()
delegate in class DelegatingCommandStackDelegatingCommandStack.delegate()public void execute(Command command)
execute in interface CommandStackexecute in class DelegatingCommandStackDelegatingCommandStack.execute(org.eclipse.emf.common.command.Command)public void undo()
undo in interface CommandStackundo in class DelegatingCommandStackBasicCommandStack.undo()public void redo()
redo in interface CommandStackredo in class DelegatingCommandStackBasicCommandStack.redo()public void flush()
flush in interface CommandStackflush in class DelegatingCommandStackCommandStack.flush()public boolean isLeftSaveNeeded()
ICompareCommandStack.leftSaveIsDone() was call the last.isLeftSaveNeeded in interface ICompareCommandStackICompareCommandStack.leftSaveIsDone() was call the last.ICompareCommandStack.isLeftSaveNeeded()public boolean isRightSaveNeeded()
ICompareCommandStack.rightSaveIsDone() was call the last.isRightSaveNeeded in interface ICompareCommandStackICompareCommandStack.rightSaveIsDone() was call the last.ICompareCommandStack.isRightSaveNeeded()public void leftSaveIsDone()
leftSaveIsDone in interface ICompareCommandStackICompareCommandStack.leftSaveIsDone()public void rightSaveIsDone()
rightSaveIsDone in interface ICompareCommandStackICompareCommandStack.rightSaveIsDone()
Copyright (c) 2006, 2015 Obeo and others. All rights reserved.