swingwtx.swing.undo
Class UndoManager
java.lang.Object
swingwtx.swing.undo.AbstractUndoableEdit
swingwtx.swing.undo.CompoundEdit
swingwtx.swing.undo.UndoManager
- All Implemented Interfaces:
- java.util.EventListener, UndoableEdit, UndoableEditListener
- public class UndoManager
- extends CompoundEdit
- implements UndoableEditListener
UndoManager
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
UndoManager
public UndoManager()
setLimit
public void setLimit(int limit)
getLimit
public int getLimit()
discardAllEdits
public void discardAllEdits()
- Remove all the edits tracked by this UndoManager
undoTo
protected void undoTo(UndoableEdit undoableEdit)
throws CannotUndoException
- Throws:
CannotUndoException
undo
public void undo()
throws CannotUndoException
- Specified by:
undo
in interface UndoableEdit
- Overrides:
undo
in class CompoundEdit
- Throws:
CannotUndoException
redoTo
protected void redoTo(UndoableEdit undoableEdit)
throws CannotRedoException
- Throws:
CannotRedoException
redo
public void redo()
throws CannotRedoException
- Specified by:
redo
in interface UndoableEdit
- Overrides:
redo
in class CompoundEdit
- Throws:
CannotRedoException
trimEdits
protected void trimEdits(int from,
int to)
trimForLimit
protected void trimForLimit()
undoOrRedo
public void undoOrRedo()
throws CannotRedoException,
CannotUndoException
- Throws:
CannotRedoException
CannotUndoException
canUndoOrRedo
public boolean canUndoOrRedo()
canUndo
public boolean canUndo()
- Specified by:
canUndo
in interface UndoableEdit
- Overrides:
canUndo
in class CompoundEdit
canRedo
public boolean canRedo()
- Specified by:
canRedo
in interface UndoableEdit
- Overrides:
canRedo
in class CompoundEdit
addEdit
public boolean addEdit(UndoableEdit undoableEdit)
- Description copied from class:
AbstractUndoableEdit
- Default implementations do nothing. Override in implementing classes
- Specified by:
addEdit
in interface UndoableEdit
- Overrides:
addEdit
in class CompoundEdit
end
public void end()
- Overrides:
end
in class CompoundEdit
getUndoOrRedoPresentationName
public java.lang.String getUndoOrRedoPresentationName()
getUndoPresentationName
public java.lang.String getUndoPresentationName()
- Specified by:
getUndoPresentationName
in interface UndoableEdit
- Overrides:
getUndoPresentationName
in class CompoundEdit
getRedoPresentationName
public java.lang.String getRedoPresentationName()
- Specified by:
getRedoPresentationName
in interface UndoableEdit
- Overrides:
getRedoPresentationName
in class CompoundEdit
undoableEditHappened
public void undoableEditHappened(UndoableEditEvent undoableEditEvent)
- Specified by:
undoableEditHappened
in interface UndoableEditListener
editToBeUndone
protected UndoableEdit editToBeUndone()
- Returns the most recent significant UndoableEdit that can be undone
editToBeRedone
protected UndoableEdit editToBeRedone()
- Returns the most recent significant UndoableEdit that can be redone