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
All Methods Instance Methods Abstract Methods Modifier and Type Method Description void
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
clearUndo()
Clear all undoable/redoable transactionsjava.lang.String
getRedoName()
Returns a description of the change that would be "redone".java.lang.String
getUndoName()
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 Detail
-
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 java.io.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:
java.io.IOException
- if an IO error occurs
-
redo
void redo() throws java.io.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:
java.io.IOException
- if an IO error occurs
-
getUndoName
java.lang.String getUndoName()
Returns a description of the chanage that would be "undone".
-
getRedoName
java.lang.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
-
-