Package ghidra.framework.model
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 TypeMethodDescriptionvoid
addTransactionListener
(TransactionListener listener) Adds the given transaction listener to this domain objectboolean
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
Clear all undoable/redoable transactionsReturns a description of the change that would be "redone".Returns a description of the chanage 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
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
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
Adds the given transaction listener to this domain object- Parameters:
listener
- the new transaction listener to add
-
removeTransactionListener
Removes the given transaction listener from this domain object.- Parameters:
listener
- the transaction listener to remove
-