Package org.eclipse.emf.compare.command
Class DelegatingCommandStack
java.lang.Object
com.google.common.collect.ForwardingObject
org.eclipse.emf.compare.command.DelegatingCommandStack
- All Implemented Interfaces:
CommandStack
- Direct Known Subclasses:
CompareCommandStack
public abstract class DelegatingCommandStack
extends com.google.common.collect.ForwardingObject
implements CommandStack
Abstract implementation that forward method calls to a
delegatating
CommandStack
.- Since:
- 4.0
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionvoid
addCommandStackListener
(CommandStackListener listener) boolean
canRedo()
boolean
canUndo()
protected abstract CommandStack
delegate()
Returns the backing delegate instance that methods are forwarded to.void
void
flush()
protected void
notifyListeners
(Object source) This is called to ensure thatCommandStackListener.commandStackChanged(java.util.EventObject)
is called for each listener.void
redo()
void
void
undo()
Methods inherited from class com.google.common.collect.ForwardingObject
toString
-
Constructor Details
-
DelegatingCommandStack
public DelegatingCommandStack()Default constructor.
-
-
Method Details
-
delegate
Returns the backing delegate instance that methods are forwarded to.- Specified by:
delegate
in classcom.google.common.collect.ForwardingObject
- Returns:
- the backing delegate instance that methods are forwarded to.
-
execute
- Specified by:
execute
in interfaceCommandStack
- See Also:
-
canUndo
public boolean canUndo()- Specified by:
canUndo
in interfaceCommandStack
- See Also:
-
undo
public void undo()- Specified by:
undo
in interfaceCommandStack
- See Also:
-
canRedo
public boolean canRedo()- Specified by:
canRedo
in interfaceCommandStack
- See Also:
-
getUndoCommand
- Specified by:
getUndoCommand
in interfaceCommandStack
- See Also:
-
getRedoCommand
- Specified by:
getRedoCommand
in interfaceCommandStack
- See Also:
-
getMostRecentCommand
- Specified by:
getMostRecentCommand
in interfaceCommandStack
- See Also:
-
redo
public void redo()- Specified by:
redo
in interfaceCommandStack
- See Also:
-
flush
public void flush()- Specified by:
flush
in interfaceCommandStack
- See Also:
-
addCommandStackListener
- Specified by:
addCommandStackListener
in interfaceCommandStack
- See Also:
-
removeCommandStackListener
- Specified by:
removeCommandStackListener
in interfaceCommandStack
- See Also:
-
notifyListeners
This is called to ensure thatCommandStackListener.commandStackChanged(java.util.EventObject)
is called for each listener.- Parameters:
source
- the source of the notification
-