com.vividsolutions.jump.workbench.model
Class UndoableCommand

java.lang.Object
  extended bycom.vividsolutions.jump.workbench.model.UndoableCommand

public abstract class UndoableCommand
extends java.lang.Object

An action that can be rolled back. Similar to an UndoableEdit, but assumes that the action is yet to be executed, whereas an UndoableEdit assumes that the action has already been executed (i.e. it has a #redo method but not a #do method).

See Also:
UndoableEdit

Field Summary
static UndoableCommand DUMMY
           
 
Constructor Summary
UndoableCommand(java.lang.String name)
           
 
Method Summary
protected  void dispose()
          Releases resources.
abstract  void execute()
          If there is an exception that leaves this UndoableCommand execution partially complete and non-unexecutable, be sure to call #reportIrreversibleChange() on the UndoableEditReceiver (which can be obtained from the LayerManager).
 java.lang.String getName()
           
 javax.swing.undo.UndoableEdit toUndoableEdit()
           
abstract  void unexecute()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

DUMMY

public static final UndoableCommand DUMMY
Constructor Detail

UndoableCommand

public UndoableCommand(java.lang.String name)
Method Detail

dispose

protected void dispose()
Releases resources.


execute

public abstract void execute()
If there is an exception that leaves this UndoableCommand execution partially complete and non-unexecutable, be sure to call #reportIrreversibleChange() on the UndoableEditReceiver (which can be obtained from the LayerManager).

See Also:
UndoableEditReceiver.reportIrreversibleChange()

unexecute

public abstract void unexecute()

toUndoableEdit

public javax.swing.undo.UndoableEdit toUndoableEdit()

getName

public java.lang.String getName()