GEF v2.0

org.eclipse.gef.commands
Class UnexecutableCommand

java.lang.Object
  |
  +--org.eclipse.gef.commands.AbstractCommand
        |
        +--org.eclipse.gef.commands.UnexecutableCommand
All Implemented Interfaces:
Command

public class UnexecutableCommand
extends AbstractCommand

This class provides a singleton INSTANCE that cannot execute.


Field Summary
static UnexecutableCommand INSTANCE
           
 
Fields inherited from interface org.eclipse.gef.commands.Command
copyright
 
Method Summary
 boolean canExecute()
          This indicates whether the comamad is valid to execute.
 boolean canUndo()
          This returns whether the command can be undone.
 void execute()
          This will perform the command activity required for the effect.
 void redo()
          This will again perform the command activity required to redo the effect after undoing the effect.
 
Methods inherited from class org.eclipse.gef.commands.AbstractCommand
chain, dispose, getAffectedObjects, getDebugLabel, getDescription, getLabel, getResult, setDebugLabel, setDescription, setLabel, undo
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

INSTANCE

public static final UnexecutableCommand INSTANCE
Method Detail

canExecute

public boolean canExecute()
Description copied from interface: Command
This indicates whether the comamad is valid to execute. The INSTANCE.canExecute() always returns false. This must be called before calling execute.
Overrides:
canExecute in class AbstractCommand

canUndo

public boolean canUndo()
Description copied from interface: Command
This returns whether the command can be undone. The result of calling this before execute is well defined, but the result of calling this before calling canExecute is undefined, i.e., a command that retuns false for canExecute may return true for canUndo, even though that is a contradiction.
Overrides:
canUndo in class AbstractCommand

execute

public void execute()
Description copied from interface: Command
This will perform the command activity required for the effect. The effect of calling execute when canExecute returns false, or when canExecute hasn't been called, is undefined.
Overrides:
execute in class AbstractCommand

redo

public void redo()
Description copied from interface: Command
This will again perform the command activity required to redo the effect after undoing the effect. The effect, if any, of calling redo before undo is called is undefined. Note that if you implement redo to call execute then any derived class will be restricted to by that decision also.
Overrides:
redo in class AbstractCommand

GEF v2.0