Package ghidra.framework.model

# Interface Undoable

All Known Subinterfaces:
  `DataTypeArchive`, `DataTypeManagerDomainObject`, `Program`, `UndoableDomainObject`

All Known Implementing Classes:
  `DataTypeArchiveDB`, `DomainObjectAdapterDB`, `ProgramDB`, `URLLinkObject`

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`
  `addTransactionListener(TransactionListener listener)`
  Adds the given transaction listener to this domain object
  `boolean`
  `canRedo()`
  Returns true if there is a later state to "redo" to.
  `boolean`
  `canUndo()`
  Returns true if there is a previous state to "undo" to.
  `void`
  `clearUndo()`
  Clear all undoable/redoable transactions
  `List<String>`
  `getAllRedoNames()`
  Returns a list of the names of all current redo transactions
  `List<String>`
  `getAllUndoNames()`
  Returns a list of the names of all current undo transactions
  `String`
  `getRedoName()`
  Returns a description of the change that would be "redone".
  `String`
  `getUndoName()`
  Returns a description of the change that would be "undone".
  `void`
  `redo()`
  Returns to a latter state that exists because of an undo.
  `void`
  `removeTransactionListener(TransactionListener listener)`
  Removes the given transaction listener from this domain object.
  `void`
  `undo()`
  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 change that would be "undone".
    Returns:
      a description of the change that would be "undone".

  - ### getRedoName

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

  - ### getAllUndoNames

    List<String> getAllUndoNames()
    Returns a list of the names of all current undo transactions
    Returns:
      a list of the names of all current undo transactions

  - ### getAllRedoNames

    List<String> getAllRedoNames()
    Returns a list of the names of all current redo transactions
    Returns:
      a list of the names of all current redo transactions

  - ### 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