Class 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()

    • 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()
      • 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.
      • isReceiving

        public boolean isReceiving()