public class CommandHistory
extends java.lang.Object
Constructor and Description |
---|
CommandHistory()
Initializes a new
CommandHistory instance. |
Modifier and Type | Method and Description |
---|---|
void |
clear()
Clears the undo/redo history.
|
int |
getCapacity()
Gets how much commands can be saved in the undo history.
|
Command |
getNextRedo()
Gets the command that will be redone by the next call to
UndoManager.redo() . |
Command |
getNextUndo()
Gets the command that will be undone by the next call to
UndoManager.undo() . |
boolean |
mergeUndoRecords(int numRecords,
java.lang.String title)
Merges several undo records into a single composite record.
|
void |
setCapacity(int value)
Sets the maximum number of commands that can be saved in the undo history.
|
public CommandHistory()
CommandHistory
instance.public boolean mergeUndoRecords(int numRecords, java.lang.String title)
numRecords
- Specifies how many records at the end of the command list should be merged.title
- Specifies the title of the new command.public void clear()
public Command getNextUndo()
UndoManager.undo()
.public Command getNextRedo()
UndoManager.redo()
.public int getCapacity()
public void setCapacity(int value)
value
- An integer value specifying how much commands can be saved in
the undo/redo history before dropping the oldest command.