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, removeCommandStackListener
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
addCommandStackListener, canRedo, canUndo, getMostRecentCommand, getRedoCommand, getUndoCommand, removeCommandStackListener
public CompareCommandStack(CommandStack commandStack)
commandStack
.commandStack
- the command stack to which this instance will delegate.public void dispose()
dispose
in interface IDisposable
IDisposable.dispose()
protected CommandStack delegate()
delegate
in class DelegatingCommandStack
DelegatingCommandStack.delegate()
public void execute(Command command)
execute
in interface CommandStack
execute
in class DelegatingCommandStack
DelegatingCommandStack.execute(org.eclipse.emf.common.command.Command)
public void undo()
undo
in interface CommandStack
undo
in class DelegatingCommandStack
BasicCommandStack.undo()
public void redo()
redo
in interface CommandStack
redo
in class DelegatingCommandStack
BasicCommandStack.redo()
public void flush()
flush
in interface CommandStack
flush
in class DelegatingCommandStack
CommandStack.flush()
public boolean isLeftSaveNeeded()
ICompareCommandStack.leftSaveIsDone()
was call the last.isLeftSaveNeeded
in interface ICompareCommandStack
ICompareCommandStack.leftSaveIsDone()
was call the last.ICompareCommandStack.isLeftSaveNeeded()
public boolean isRightSaveNeeded()
ICompareCommandStack.rightSaveIsDone()
was call the last.isRightSaveNeeded
in interface ICompareCommandStack
ICompareCommandStack.rightSaveIsDone()
was call the last.ICompareCommandStack.isRightSaveNeeded()
public void leftSaveIsDone()
leftSaveIsDone
in interface ICompareCommandStack
ICompareCommandStack.leftSaveIsDone()
public void rightSaveIsDone()
rightSaveIsDone
in interface ICompareCommandStack
ICompareCommandStack.rightSaveIsDone()
Copyright (c) 2006, 2015 Obeo and others. All rights reserved.