Class UndoableEditReceiver
- java.lang.Object
-
- org.locationtech.jts.jump.workbench.model.UndoableEditReceiver
-
public class UndoableEditReceiver extends Object
Receives UndoableEdits from PlugIns and CursorTools. Also provides access to a Task's UndoManager.In the documentation, the "receiving phase" refers to the time between the calls to #start and #stop.
If there is an exception that leaves this UndoableCommand execution partially complete and non-unexecutable, be sure to call #reportIrreversibleChange()
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static interface
UndoableEditReceiver.Listener
-
Constructor Summary
Constructors Constructor Description UndoableEditReceiver()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
add(UndoableEditReceiver.Listener listener)
UndoManager
getUndoManager()
boolean
isReceiving()
void
receive(UndoableEdit undoableEdit)
If the currently executing PlugIn or AbstractCursorTool is not undoable, it should simply not call this method; the undo history will be cleared.void
reportIrreversibleChange()
Notifies this UndoableEditReceiver that something non-undoable has happened.void
reportNothingToUndoYet()
Specifies that the undo history should not be modified at the end of the current receiving phase, if neither #receive nor #reportIrreversibleChange is called.void
startReceiving()
void
stopReceiving()
-
-
-
Method Detail
-
startReceiving
public void startReceiving()
-
reportNothingToUndoYet
public void reportNothingToUndoYet()
Specifies that the undo history should not be modified at the end of the current receiving phase, if neither #receive nor #reportIrreversibleChange is called. If none of the three methods are called during the receiving phase, an irreversible change is assumed to have occurred, and the undo history will be truncated.
-
reportIrreversibleChange
public void reportIrreversibleChange()
Notifies this UndoableEditReceiver that something non-undoable has happened. Be sure to call this if an Exception occurs during the execution of an UndoableCommand, leaving it partially complete and non-unexecutable.
-
stopReceiving
public void stopReceiving()
-
add
public void add(UndoableEditReceiver.Listener listener)
-
receive
public void receive(UndoableEdit undoableEdit)
If the currently executing PlugIn or AbstractCursorTool is not undoable, it should simply not call this method; the undo history will be cleared.
-
getUndoManager
public UndoManager getUndoManager()
-
isReceiving
public boolean isReceiving()
-
-