|
JIDE Common Layer 2.7.6 | ||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectjavax.swing.undo.AbstractUndoableEdit
javax.swing.undo.CompoundEdit
javax.swing.undo.UndoManager
com.jidesoft.swing.DelayUndoManager
public class DelayUndoManager
An undo manager that aggregates UndoableEdits into one CompoundEdit if they are executed very close to each other. By default, the gap is 500 ms. You can control it by passing in a different number in the constructor.
Field Summary | |
---|---|
protected javax.swing.Timer |
_timer
|
Fields inherited from class javax.swing.undo.CompoundEdit |
---|
edits |
Fields inherited from class javax.swing.undo.AbstractUndoableEdit |
---|
RedoName, UndoName |
Constructor Summary | |
---|---|
DelayUndoManager()
|
|
DelayUndoManager(int delay)
|
Method Summary | |
---|---|
boolean |
addEdit(javax.swing.undo.UndoableEdit anEdit)
|
void |
addEditWithoutCaching()
Calls super.addEdit without caching. |
boolean |
canRedo()
Override to commit the cache before checking redo status. |
boolean |
canUndo()
Override to commit the cache before checking undo status. |
void |
commitCache()
Commits the cached edit. |
void |
discardAllEdits()
|
void |
discardCache()
|
boolean |
isCacheEmpty()
Checks if there are pending edits in the DelayUndoManager. |
void |
redo()
Override to commit the cache before redo. |
void |
undo()
Override to commit the cache before undo. |
Methods inherited from class javax.swing.undo.UndoManager |
---|
canUndoOrRedo, editToBeRedone, editToBeUndone, end, getLimit, getRedoPresentationName, getUndoOrRedoPresentationName, getUndoPresentationName, redoTo, setLimit, toString, trimEdits, trimForLimit, undoableEditHappened, undoOrRedo, undoTo |
Methods inherited from class javax.swing.undo.CompoundEdit |
---|
die, getPresentationName, isInProgress, isSignificant, lastEdit |
Methods inherited from class javax.swing.undo.AbstractUndoableEdit |
---|
replaceEdit |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Field Detail |
---|
protected javax.swing.Timer _timer
Constructor Detail |
---|
public DelayUndoManager()
public DelayUndoManager(int delay)
Method Detail |
---|
public boolean isCacheEmpty()
public void commitCache()
public void addEditWithoutCaching()
public void discardCache()
public boolean addEdit(javax.swing.undo.UndoableEdit anEdit)
addEdit
in interface javax.swing.undo.UndoableEdit
addEdit
in class javax.swing.undo.UndoManager
public boolean canUndo()
canUndo
in interface javax.swing.undo.UndoableEdit
canUndo
in class javax.swing.undo.UndoManager
public boolean canRedo()
canRedo
in interface javax.swing.undo.UndoableEdit
canRedo
in class javax.swing.undo.UndoManager
public void undo() throws javax.swing.undo.CannotUndoException
undo
in interface javax.swing.undo.UndoableEdit
undo
in class javax.swing.undo.UndoManager
javax.swing.undo.CannotUndoException
public void redo() throws javax.swing.undo.CannotRedoException
redo
in interface javax.swing.undo.UndoableEdit
redo
in class javax.swing.undo.UndoManager
javax.swing.undo.CannotRedoException
public void discardAllEdits()
discardAllEdits
in class javax.swing.undo.UndoManager
|
JIDE Common Layer 2.7.6 | ||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |