Class CompoundUndoManager
java.lang.Object
javax.swing.undo.AbstractUndoableEdit
javax.swing.undo.CompoundEdit
javax.swing.undo.UndoManager
net.thevpc.jeep.editor.CompoundUndoManager
- All Implemented Interfaces:
Serializable, EventListener, UndoableEditListener, UndoableEdit
A simple UndoManager that groups the Edits in each 0.5 second. If the time
difference between the current undo and the last one is less than 0.5 secs,
then the two edits are compound.
- Author:
- Ayman Al-Sairafi
- See Also:
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final intDelay between consecutive edits in ms where edits are added together.Fields inherited from class CompoundEdit
editsFields inherited from class AbstractUndoableEdit
RedoName, UndoName -
Constructor Summary
Constructors -
Method Summary
Methods inherited from class UndoManager
canUndoOrRedo, editToBeRedone, editToBeUndone, end, getLimit, getRedoPresentationName, getUndoOrRedoPresentationName, getUndoPresentationName, redoTo, setLimit, toString, trimEdits, trimForLimit, undoableEditHappened, undoOrRedo, undoToMethods inherited from class CompoundEdit
die, getPresentationName, isInProgress, isSignificant, lastEditMethods inherited from class AbstractUndoableEdit
replaceEdit
-
Field Details
-
IDLE_DELAY_MS
public static final int IDLE_DELAY_MSDelay between consecutive edits in ms where edits are added together. If the delay is greater than this, then separate undo operations are done, otherwise they are combined.- See Also:
-
-
Constructor Details
-
CompoundUndoManager
public CompoundUndoManager()
-
-
Method Details
-
addEdit
- Specified by:
addEditin interfaceUndoableEdit- Overrides:
addEditin classUndoManager
-
canRedo
public boolean canRedo()- Specified by:
canRedoin interfaceUndoableEdit- Overrides:
canRedoin classUndoManager
-
canUndo
public boolean canUndo()- Specified by:
canUndoin interfaceUndoableEdit- Overrides:
canUndoin classUndoManager
-
discardAllEdits
public void discardAllEdits()- Overrides:
discardAllEditsin classUndoManager
-
redo
- Specified by:
redoin interfaceUndoableEdit- Overrides:
redoin classUndoManager- Throws:
CannotRedoException
-
undo
- Specified by:
undoin interfaceUndoableEdit- Overrides:
undoin classUndoManager- Throws:
CannotUndoException
-