public interface CPDFUndoManager
Modifier and Type | Method and Description |
---|---|
void |
addLogListener(CPDFUndoLogListener logListener)
Adds an
CPDFUndoLogListener for debug |
void |
addOnUndoHistoryChangeListener(OnUndoHistoryChangeListener onUndoHistoryChangeListener)
Adds an
OnUndoHistoryChangeListener for being notified of changes to the undo manager's edit history (i.e. |
boolean |
canRedo()
Returns whether there are edits that can be redone or not.
|
boolean |
canUndo()
Returns whether there are edits that can be undone or not.
|
void |
clearHistory()
Clears the history of all currently recorded edits.
|
void |
enable(boolean enable)
Whether to enable the undoing/redoing.
|
boolean |
isEnable()
Returns the enabled status for undoing/redoing.
|
void |
redo()
Redoes the next edit or throws an exception if a redo operation is not possible.
|
void |
removeOnUndoHistoryChangeListener(OnUndoHistoryChangeListener onUndoHistoryChangeListener)
Removes a previously added
OnUndoHistoryChangeListener . |
void |
undo()
Undoes the last edit or throws an exception if an undo operation is not possible.It's recommended that you check whether an undo operation is available using
canUndo() before calling this method. |
boolean canUndo()
undo()
will throw an exception.boolean canRedo()
redo()
will throw an exception.void undo() throws CPDFUndoFailedException
canUndo()
before calling this method.
Undoing may be unavailable if there are no edits on the undo stack or if the latest edit on the undo stack cannot be undone.
When undoing an edit, the edit is moved to the internal redo stack.CPDFUndoFailedException
- Thrown if an undo operation was unsuccessful, if the undo stack was empty, or if the last edit is not undoable.void redo() throws CPDFRedoFailedException
canRedo()
()} before calling this method.
Redoing may be unavailable if there are no edits on the redo stack or if the latest edit on the redo stack cannot be redone. When redoing an edit, the edit is moved to the internal undo stack.CPDFRedoFailedException
- Thrown if redo operation was unsuccessful, if the redo stack was empty, or if the last edit is not redoable.void clearHistory()
void addOnUndoHistoryChangeListener(OnUndoHistoryChangeListener onUndoHistoryChangeListener)
OnUndoHistoryChangeListener
for being notified of changes to the undo manager's edit history (i.e. its undo and redo stacks).
If a listener has already been added previously, this method will be a no-op.
See Also removeOnUndoHistoryChangeListener(OnUndoHistoryChangeListener)
.onUndoHistoryChangeListener
- That should be notifiedvoid removeOnUndoHistoryChangeListener(OnUndoHistoryChangeListener onUndoHistoryChangeListener)
OnUndoHistoryChangeListener
. Upon calling this method, listener will no longer be notified of any changes.
If listener has not been added previously, this method will be a no-op.
See Also addOnUndoHistoryChangeListener(OnUndoHistoryChangeListener)
.onUndoHistoryChangeListener
- That should be removed.void enable(boolean enable)
enable
- True if the undoing/redoing is enabled, false otherwise.boolean isEnable()
void addLogListener(CPDFUndoLogListener logListener)
CPDFUndoLogListener
for debuglogListener
- That should be notified