Package groovy.console.ui.text
Class TextUndoManager
java.lang.Object
javax.swing.undo.AbstractUndoableEdit
javax.swing.undo.CompoundEdit
javax.swing.undo.UndoManager
groovy.console.ui.text.TextUndoManager
- All Implemented Interfaces:
- Serializable,- EventListener,- UndoableEditListener,- UndoableEdit
To use this, simply drop this as an UndoableEditListener into your document,
 and then create actions to call undo/redo as needed (checking can undo/redo
 first, of course).
- See Also:
- 
Field SummaryFields inherited from class javax.swing.undo.CompoundEditeditsFields inherited from class javax.swing.undo.AbstractUndoableEditRedoName, UndoName
- 
Constructor SummaryConstructors
- 
Method SummaryModifier and TypeMethodDescriptionvoidvoiddie()voidprotected voidfirePropertyChangeEvent(String name, boolean oldValue, boolean newValue) booleanvoidredo()protected voidredoTo(UndoableEdit edit) voidvoidreset()protected voidtrimEdits(int from, int to) voidundo()voidMethods inherited from class javax.swing.undo.UndoManageraddEdit, canRedo, canUndo, canUndoOrRedo, editToBeRedone, editToBeUndone, end, getLimit, getRedoPresentationName, getUndoOrRedoPresentationName, getUndoPresentationName, setLimit, toString, trimForLimit, undoOrRedo, undoToMethods inherited from class javax.swing.undo.CompoundEditgetPresentationName, isInProgress, isSignificant, lastEditMethods inherited from class javax.swing.undo.AbstractUndoableEditreplaceEdit
- 
Constructor Details- 
TextUndoManagerpublic TextUndoManager()Creates a new instance of TextUndoManager.
 
- 
- 
Method Details- 
addPropertyChangeListener
- 
diepublic void die()- Specified by:
- diein interface- UndoableEdit
- Overrides:
- diein class- CompoundEdit
 
- 
discardAllEditspublic void discardAllEdits()- Overrides:
- discardAllEditsin class- UndoManager
 
- 
firePropertyChangeEvent
- 
hasChangedpublic boolean hasChanged()
- 
redo- Specified by:
- redoin interface- UndoableEdit
- Overrides:
- redoin class- UndoManager
- Throws:
- CannotRedoException
 
- 
redoTo- Overrides:
- redoToin class- UndoManager
 
- 
removePropertyChangeListener
- 
resetpublic void reset()
- 
trimEditsprotected void trimEdits(int from, int to) - Overrides:
- trimEditsin class- UndoManager
 
- 
undo- Specified by:
- undoin interface- UndoableEdit
- Overrides:
- undoin class- UndoManager
- Throws:
- CannotUndoException
 
- 
undoableEditHappened- Specified by:
- undoableEditHappenedin interface- UndoableEditListener
- Overrides:
- undoableEditHappenedin class- UndoManager
 
 
-