Class UndoableCommand
java.lang.Object
com.vividsolutions.jump.workbench.model.UndoableCommand
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:
-
Field Summary
Fields -
Constructor Summary
ConstructorsConstructorDescriptionUndoableCommand(String name) UndoableCommand with a name to be shown in the user interface.UndoableCommand(String name, Layer layer) UndoableCommand with a name and a layer parameter. -
Method Summary
Modifier and TypeMethodDescriptionprotected voiddispose()Releases resources and make the edit action unsignificant, so that it will be ignored in the undo chain.abstract voidexecute()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).getLayer()getName()booleanvoidabstract void
-
Field Details
-
DUMMY
-
-
Constructor Details
-
UndoableCommand
UndoableCommand with a name to be shown in the user interface. -
UndoableCommand
-
-
Method Details
-
setLayer
-
getLayer
-
dispose
protected void dispose()Releases resources and make the edit action unsignificant, so that it will be ignored in the undo chain. If a UndoableCommand subclasse has resources to be released, oveload this method and call super.dispose() set canceled to true. -
isCanceled
public boolean isCanceled() -
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:
-
unexecute
public abstract void unexecute() -
toUndoableEdit
-
getName
-