roneditor.ronview.commands
Class DeleteTokenCommand

java.lang.Object
  extended by org.eclipse.gef.commands.Command
      extended by roneditor.ronview.commands.DeleteTokenCommand

public class DeleteTokenCommand
extends org.eclipse.gef.commands.Command

Command for removing a token from its parent place. This is undoable.


Field Summary
private static java.lang.String DeleteCommand_Label
           
private  ronmodel.HLPlace parent
           
private  ronmodel.Token token
           
 
Constructor Summary
DeleteTokenCommand(ronmodel.Token token)
           
 
Method Summary
 void execute()
          The child gets removed from its parent.
 void redo()
          Redoes the command by removing the object from its container again.
 void undo()
          Undoes the command by readding the previously removed object to its former container that execute() has saved.
 
Methods inherited from class org.eclipse.gef.commands.Command
canExecute, canUndo, chain, dispose, getDebugLabel, getLabel, setDebugLabel, setLabel
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

DeleteCommand_Label

private static final java.lang.String DeleteCommand_Label
See Also:
Constant Field Values

token

private final ronmodel.Token token

parent

private ronmodel.HLPlace parent
Constructor Detail

DeleteTokenCommand

public DeleteTokenCommand(ronmodel.Token token)
Method Detail

execute

public void execute()
The child gets removed from its parent. The container is stored for undoing purposes.

Overrides:
execute in class org.eclipse.gef.commands.Command
See Also:
Command.execute()

undo

public void undo()
Undoes the command by readding the previously removed object to its former container that execute() has saved. (non-Javadoc)

Overrides:
undo in class org.eclipse.gef.commands.Command
See Also:
Command.undo()

redo

public void redo()
Redoes the command by removing the object from its container again.

Overrides:
redo in class org.eclipse.gef.commands.Command