Class CompareCommandStack
java.lang.Object
com.google.common.collect.ForwardingObject
org.eclipse.emf.compare.command.DelegatingCommandStack
org.eclipse.emf.compare.command.impl.CompareCommandStack
- All Implemented Interfaces:
CommandStack,ICompareCommandStack,IDisposable
public class CompareCommandStack
extends DelegatingCommandStack
implements ICompareCommandStack, IDisposable
A simple
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.
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic classSimple data structure acting like a command stack but without any execution capability. -
Constructor Summary
ConstructorsConstructorDescriptionCompareCommandStack(CommandStack commandStack) Creates a new instance that delegates to the givencommandStack. -
Method Summary
Modifier and TypeMethodDescriptionprotected CommandStackdelegate()Returns the backing delegate instance that methods are forwarded to.voiddispose()voidvoidflush()booleanReturns whether the left model has changes sinceICompareCommandStack.leftSaveIsDone()was call the last.booleanReturns whether the right model has changes sinceICompareCommandStack.rightSaveIsDone()was call the last.voidCalled after a save of the left model has been successfully performed.voidredo()voidCalled after a save of the right model has been successfully performed.voidundo()Methods inherited from class org.eclipse.emf.compare.command.DelegatingCommandStack
addCommandStackListener, canRedo, canUndo, getMostRecentCommand, getRedoCommand, getUndoCommand, notifyListeners, removeCommandStackListenerMethods inherited from class com.google.common.collect.ForwardingObject
toStringMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitMethods inherited from interface org.eclipse.emf.common.command.CommandStack
addCommandStackListener, canRedo, canUndo, getMostRecentCommand, getRedoCommand, getUndoCommand, removeCommandStackListener
-
Constructor Details
-
CompareCommandStack
Creates a new instance that delegates to the givencommandStack.- Parameters:
commandStack- the command stack to which this instance will delegate.
-
-
Method Details
-
dispose
public void dispose()- Specified by:
disposein interfaceIDisposable- See Also:
-
delegate
Returns the backing delegate instance that methods are forwarded to.- Specified by:
delegatein classDelegatingCommandStack- Returns:
- the backing delegate instance that methods are forwarded to.
- See Also:
-
execute
- Specified by:
executein interfaceCommandStack- Overrides:
executein classDelegatingCommandStack- See Also:
-
undo
public void undo()- Specified by:
undoin interfaceCommandStack- Overrides:
undoin classDelegatingCommandStack- See Also:
-
redo
public void redo()- Specified by:
redoin interfaceCommandStack- Overrides:
redoin classDelegatingCommandStack- See Also:
-
flush
public void flush()- Specified by:
flushin interfaceCommandStack- Overrides:
flushin classDelegatingCommandStack- See Also:
-
isLeftSaveNeeded
public boolean isLeftSaveNeeded()Returns whether the left model has changes sinceICompareCommandStack.leftSaveIsDone()was call the last.- Specified by:
isLeftSaveNeededin interfaceICompareCommandStack- Returns:
- whether the left model has changes since
ICompareCommandStack.leftSaveIsDone()was call the last. - See Also:
-
isRightSaveNeeded
public boolean isRightSaveNeeded()Returns whether the right model has changes sinceICompareCommandStack.rightSaveIsDone()was call the last.- Specified by:
isRightSaveNeededin interfaceICompareCommandStack- Returns:
- whether the right model has changes since
ICompareCommandStack.rightSaveIsDone()was call the last. - See Also:
-
leftSaveIsDone
public void leftSaveIsDone()Called after a save of the left model has been successfully performed.- Specified by:
leftSaveIsDonein interfaceICompareCommandStack- See Also:
-
rightSaveIsDone
public void rightSaveIsDone()Called after a save of the right model has been successfully performed.- Specified by:
rightSaveIsDonein interfaceICompareCommandStack- See Also:
-