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 adelegatatingCommandStack.- Since:
- 4.0
-
-
Constructor Summary
Constructors Constructor Description DelegatingCommandStack()Default constructor.
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description voidaddCommandStackListener(CommandStackListener listener)booleancanRedo()booleancanUndo()protected abstract CommandStackdelegate()Returns the backing delegate instance that methods are forwarded to.voidexecute(Command command)voidflush()CommandgetMostRecentCommand()CommandgetRedoCommand()CommandgetUndoCommand()protected voidnotifyListeners(Object source)This is called to ensure thatCommandStackListener.commandStackChanged(java.util.EventObject)is called for each listener.voidredo()voidremoveCommandStackListener(CommandStackListener listener)voidundo()
-
-
-
Method Detail
-
delegate
protected abstract CommandStack delegate()
Returns the backing delegate instance that methods are forwarded to.- Specified by:
delegatein classcom.google.common.collect.ForwardingObject- Returns:
- the backing delegate instance that methods are forwarded to.
-
execute
public void execute(Command command)
- Specified by:
executein interfaceCommandStack- See Also:
CommandStack.execute(org.eclipse.emf.common.command.Command)
-
canUndo
public boolean canUndo()
- Specified by:
canUndoin interfaceCommandStack- See Also:
CommandStack.canUndo()
-
undo
public void undo()
- Specified by:
undoin interfaceCommandStack- See Also:
CommandStack.undo()
-
canRedo
public boolean canRedo()
- Specified by:
canRedoin interfaceCommandStack- See Also:
CommandStack.canRedo()
-
getUndoCommand
public Command getUndoCommand()
- Specified by:
getUndoCommandin interfaceCommandStack- See Also:
CommandStack.getUndoCommand()
-
getRedoCommand
public Command getRedoCommand()
- Specified by:
getRedoCommandin interfaceCommandStack- See Also:
CommandStack.getRedoCommand()
-
getMostRecentCommand
public Command getMostRecentCommand()
- Specified by:
getMostRecentCommandin interfaceCommandStack- See Also:
CommandStack.getMostRecentCommand()
-
redo
public void redo()
- Specified by:
redoin interfaceCommandStack- See Also:
CommandStack.redo()
-
flush
public void flush()
- Specified by:
flushin interfaceCommandStack- See Also:
CommandStack.flush()
-
addCommandStackListener
public void addCommandStackListener(CommandStackListener listener)
- Specified by:
addCommandStackListenerin interfaceCommandStack- See Also:
CommandStack.addCommandStackListener(org.eclipse.emf.common.command.CommandStackListener)
-
removeCommandStackListener
public void removeCommandStackListener(CommandStackListener listener)
- Specified by:
removeCommandStackListenerin interfaceCommandStack- See Also:
CommandStack.removeCommandStackListener(org.eclipse.emf.common.command.CommandStackListener)
-
notifyListeners
protected void notifyListeners(Object source)
This is called to ensure thatCommandStackListener.commandStackChanged(java.util.EventObject)is called for each listener.- Parameters:
source- the source of the notification
-
-