com.vividsolutions.jump.workbench.model
Class UndoableEditReceiver

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

public class UndoableEditReceiver
extends java.lang.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
static interface UndoableEditReceiver.Listener
           
 
Constructor Summary
UndoableEditReceiver()
           
 
Method Summary
 void add(UndoableEditReceiver.Listener listener)
           
 javax.swing.undo.UndoManager getUndoManager()
           
 boolean isReceiving()
           
 void receive(javax.swing.undo.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()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

UndoableEditReceiver

public UndoableEditReceiver()
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(javax.swing.undo.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 javax.swing.undo.UndoManager getUndoManager()

isReceiving

public boolean isReceiving()