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
 
 public class TextUndoManager extends UndoManager 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:
- Serialized Form
 
- 
- 
Field Summary- 
Fields inherited from class javax.swing.undo.CompoundEditedits
 - 
Fields inherited from class javax.swing.undo.AbstractUndoableEditRedoName, UndoName
 
- 
 - 
Constructor SummaryConstructors Constructor Description TextUndoManager()Creates a new instance of TextUndoManager.
 - 
Method SummaryAll Methods Instance Methods Concrete Methods Modifier and Type Method Description voidaddPropertyChangeListener(PropertyChangeListener pcl)voiddie()voiddiscardAllEdits()protected voidfirePropertyChangeEvent(String name, boolean oldValue, boolean newValue)booleanhasChanged()voidredo()protected voidredoTo(UndoableEdit edit)voidremovePropertyChangeListener(PropertyChangeListener pcl)voidreset()protected voidtrimEdits(int from, int to)voidundo()voidundoableEditHappened(UndoableEditEvent uee)- 
Methods inherited from class javax.swing.undo.UndoManageraddEdit, canRedo, canUndo, canUndoOrRedo, editToBeRedone, editToBeUndone, end, getLimit, getRedoPresentationName, getUndoOrRedoPresentationName, getUndoPresentationName, setLimit, toString, trimForLimit, undoOrRedo, undoTo
 - 
Methods inherited from class javax.swing.undo.CompoundEditgetPresentationName, isInProgress, isSignificant, lastEdit
 - 
Methods inherited from class javax.swing.undo.AbstractUndoableEditreplaceEdit
 
- 
 
- 
- 
- 
Method Detail- 
addPropertyChangeListenerpublic void addPropertyChangeListener(PropertyChangeListener pcl) 
 - 
diepublic void die() - Specified by:
- diein interface- UndoableEdit
- Overrides:
- diein class- CompoundEdit
 
 - 
discardAllEditspublic void discardAllEdits() - Overrides:
- discardAllEditsin class- UndoManager
 
 - 
firePropertyChangeEventprotected void firePropertyChangeEvent(String name, boolean oldValue, boolean newValue) 
 - 
hasChangedpublic boolean hasChanged() 
 - 
redopublic void redo() throws CannotRedoException- Specified by:
- redoin interface- UndoableEdit
- Overrides:
- redoin class- UndoManager
- Throws:
- CannotRedoException
 
 - 
redoToprotected void redoTo(UndoableEdit edit) - Overrides:
- redoToin class- UndoManager
 
 - 
removePropertyChangeListenerpublic void removePropertyChangeListener(PropertyChangeListener pcl) 
 - 
resetpublic void reset() 
 - 
trimEditsprotected void trimEdits(int from, int to)- Overrides:
- trimEditsin class- UndoManager
 
 - 
undopublic void undo() throws CannotUndoException- Specified by:
- undoin interface- UndoableEdit
- Overrides:
- undoin class- UndoManager
- Throws:
- CannotUndoException
 
 - 
undoableEditHappenedpublic void undoableEditHappened(UndoableEditEvent uee) - Specified by:
- undoableEditHappenedin interface- UndoableEditListener
- Overrides:
- undoableEditHappenedin class- UndoManager
 
 
- 
 
-