public class UndoManager extends Object
| Constructor and Description |
|---|
UndoManager() |
UndoManager(Action undoAction,
Action redoAction) |
UndoManager(Action undoAction,
Action redoAction,
int maxFrames) |
UndoManager(int maxFrames) |
| Modifier and Type | Method and Description |
|---|---|
<T> void |
addBuffer(BufferKey<T> key,
T buffer) |
<T> void |
addBuffer(BufferKey<T> key,
T buffer,
UndoListener listener) |
void |
addListener(UndoListener listener) |
void |
armSavePoint()
Arm a save point.
|
void |
clear()
Throw away all undo and redo information.
|
void |
clearRedo()
Throw away all redo information
|
<T> T |
getBuffer(BufferKey<T> key) |
<T> T |
getBufferForEditing(BufferKey<T> key) |
long |
getDataSize() |
int |
getMaxFrames() |
Snapshot |
getSnapshot()
Get a read-only snapshot of the current state of the buffers.
|
Class<?>[] |
getStopAtClasses() |
boolean |
isDirty()
Indicates whether the current history frame is dirty (meaning that
buffers have been checked out for editing from it).
|
boolean |
redo()
Rolls forward all buffers to the next save point, if there is one
available, and no edits have been performed since the last undo.
|
void |
registerActions(Action undoAction,
Action redoAction) |
void |
removeBuffer(BufferKey<?> key) |
void |
removeListener(UndoListener listener) |
void |
savePoint()
Save the current state of all buffers as an undo point.
|
void |
setStopAtClasses(Class<?>... stopAt) |
boolean |
undo()
Rolls back all buffers to the previous save point, if there is one still
available.
|
void |
unregisterActions() |
public void unregisterActions()
public int getMaxFrames()
public void armSavePoint()
Will do nothing if a save point is already armed, or if the current frame is the last one and it is not dirty.
public void savePoint()
public Snapshot getSnapshot()
public boolean isDirty()
true if the current history frame is dirty.public boolean undo()
true if the undo was succesful.public boolean redo()
true if the redo was succesful.public void clear()
public void clearRedo()
public <T> void addBuffer(BufferKey<T> key, T buffer)
public <T> void addBuffer(BufferKey<T> key, T buffer, UndoListener listener)
public void removeBuffer(BufferKey<?> key)
public <T> T getBuffer(BufferKey<T> key)
public <T> T getBufferForEditing(BufferKey<T> key)
public void addListener(UndoListener listener)
public void removeListener(UndoListener listener)
public Class<?>[] getStopAtClasses()
public void setStopAtClasses(Class<?>... stopAt)
public long getDataSize()
Copyright © 2011–2023 pepsoft.org. All rights reserved.