de.tu_berlin.cs.tfs.muvitorkit.ui.utils.test
Class DelegatingCommandStack

java.lang.Object
  extended by org.eclipse.gef.commands.CommandStack
      extended by de.tu_berlin.cs.tfs.muvitorkit.ui.utils.test.DelegatingCommandStack
All Implemented Interfaces:
CommandStackListener

public class DelegatingCommandStack
extends CommandStack
implements CommandStackListener

This is a delegating command stack, which delegates everything to a exchangeable current CommandStack except event listeners.

Event listeners registered to a DelegatingCommandStack will be informed whenever the currently set CommandStack changes. They will not be registered with the underlying CommandStack but they will be informed about change events of it.

Rating red

Field Summary
 
Fields inherited from class org.eclipse.gef.commands.CommandStack
listeners, POST_EXECUTE, POST_MASK, POST_REDO, POST_UNDO, PRE_EXECUTE, PRE_MASK, PRE_REDO, PRE_UNDO
 
Constructor Summary
DelegatingCommandStack()
           
 
Method Summary
 boolean canRedo()
           
 boolean canUndo()
           
 void commandStackChanged(EventObject event)
           
 void dispose()
           
 void execute(Command command)
           
 void flush()
           
 Object[] getCommands()
           
 CommandStack getCurrentCommandStack()
          Returns the current CommandStack.
 Command getRedoCommand()
           
 Command getUndoCommand()
           
 int getUndoLimit()
           
 boolean isDirty()
           
 void markSaveLocation()
           
 void redo()
           
 void setCurrentCommandStack(CommandStack stack)
          Sets the current CommandStack.
 void setUndoLimit(int undoLimit)
           
 String toString()
           
 void undo()
           
 
Methods inherited from class org.eclipse.gef.commands.CommandStack
addCommandStackEventListener, addCommandStackListener, notifyListeners, notifyListeners, removeCommandStackEventListener, removeCommandStackListener
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

DelegatingCommandStack

public DelegatingCommandStack()
Method Detail

getCurrentCommandStack

public CommandStack getCurrentCommandStack()
Returns the current CommandStack.

Returns:
the current CommandStack

setCurrentCommandStack

public void setCurrentCommandStack(CommandStack stack)
Sets the current CommandStack.

Parameters:
stack - the CommandStack to set

canRedo

public boolean canRedo()
Overrides:
canRedo in class CommandStack

canUndo

public boolean canUndo()
Overrides:
canUndo in class CommandStack

dispose

public void dispose()
Overrides:
dispose in class CommandStack

execute

public void execute(Command command)
Overrides:
execute in class CommandStack

flush

public void flush()
Overrides:
flush in class CommandStack

getCommands

public Object[] getCommands()
Overrides:
getCommands in class CommandStack

getRedoCommand

public Command getRedoCommand()
Overrides:
getRedoCommand in class CommandStack

getUndoCommand

public Command getUndoCommand()
Overrides:
getUndoCommand in class CommandStack

getUndoLimit

public int getUndoLimit()
Overrides:
getUndoLimit in class CommandStack

isDirty

public boolean isDirty()
Overrides:
isDirty in class CommandStack

markSaveLocation

public void markSaveLocation()
Overrides:
markSaveLocation in class CommandStack

redo

public void redo()
Overrides:
redo in class CommandStack

setUndoLimit

public void setUndoLimit(int undoLimit)
Overrides:
setUndoLimit in class CommandStack

undo

public void undo()
Overrides:
undo in class CommandStack

toString

public String toString()
Overrides:
toString in class Object

commandStackChanged

public void commandStackChanged(EventObject event)
Specified by:
commandStackChanged in interface CommandStackListener