Interface Undoable

All Known Subinterfaces:
DataTypeArchive, DataTypeManagerDomainObject, Program, UndoableDomainObject
All Known Implementing Classes:
DataTypeArchiveDB, DomainObjectAdapterDB, ProgramDB

public interface Undoable
Objects that implement Undoable have the ability to "remember" some number of stable states that are created as operations are performed upon them. The object then provides methods for "undoing" to a previous state or "redoing" to a later state.
  • Method Summary

    Modifier and Type
    Method
    Description
    void
    Adds the given transaction listener to this domain object
    boolean
    Returns true if there is a later state to "redo" to.
    boolean
    Returns true if there is a previous state to "undo" to.
    void
    Clear all undoable/redoable transactions
    Returns a description of the change that would be "redone".
    Returns a description of the chanage that would be "undone".
    void
    Returns to a latter state that exists because of an undo.
    void
    Removes the given transaction listener from this domain object.
    void
    Returns to the previous state.
  • Method Details

    • canUndo

      boolean canUndo()
      Returns true if there is a previous state to "undo" to.
    • canRedo

      boolean canRedo()
      Returns true if there is a later state to "redo" to.
    • clearUndo

      void clearUndo()
      Clear all undoable/redoable transactions
    • undo

      void undo() throws IOException
      Returns to the previous state. Normally, this will cause the current state to appear on the "redo" stack. This method will do nothing if there are no previous states to "undo".
      Throws:
      IOException - if an IO error occurs
    • redo

      void redo() throws IOException
      Returns to a latter state that exists because of an undo. Normally, this will cause the current state to appear on the "undo" stack. This method will do nothing if there are no latter states to "redo".
      Throws:
      IOException - if an IO error occurs
    • getUndoName

      String getUndoName()
      Returns a description of the chanage that would be "undone".
    • getRedoName

      String getRedoName()
      Returns a description of the change that would be "redone".
    • addTransactionListener

      void addTransactionListener(TransactionListener listener)
      Adds the given transaction listener to this domain object
      Parameters:
      listener - the new transaction listener to add
    • removeTransactionListener

      void removeTransactionListener(TransactionListener listener)
      Removes the given transaction listener from this domain object.
      Parameters:
      listener - the transaction listener to remove