groovy.ui.text
Class TextUndoManager
java.lang.Object
  
javax.swing.undo.AbstractUndoableEdit
      
javax.swing.undo.CompoundEdit
          
javax.swing.undo.UndoManager
              
groovy.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).
- Author:
 
  - Evan "Hippy" Slatis
 
- See Also:
 - Serialized Form
 
 
 
 
| 
Constructor Summary | 
TextUndoManager()
 
          Creates a new instance of TextUndoManager. | 
 
 
| Methods inherited from class javax.swing.undo.UndoManager | 
addEdit, canRedo, canUndo, canUndoOrRedo, editToBeRedone, editToBeUndone, end, getLimit, getRedoPresentationName, getUndoOrRedoPresentationName, getUndoPresentationName, setLimit, toString, trimForLimit, undoOrRedo, undoTo | 
 
 
 
 
TextUndoManager
public TextUndoManager()
- Creates a new instance of TextUndoManager.
 
addPropertyChangeListener
public void addPropertyChangeListener(PropertyChangeListener pcl)
 
die
public void die()
- Specified by:
 die in interface UndoableEdit- Overrides:
 die in class CompoundEdit
 
 
discardAllEdits
public void discardAllEdits()
- Overrides:
 discardAllEdits in class UndoManager
 
 
firePropertyChangeEvent
protected void firePropertyChangeEvent(String name,
                                       boolean oldValue,
                                       boolean newValue)
 
hasChanged
public boolean hasChanged()
 
redo
public void redo()
          throws CannotRedoException
- Specified by:
 redo in interface UndoableEdit- Overrides:
 redo in class UndoManager
 
- Throws:
 CannotRedoException
 
redoTo
protected void redoTo(UndoableEdit edit)
- Overrides:
 redoTo in class UndoManager
 
 
removePropertyChangeListener
public void removePropertyChangeListener(PropertyChangeListener pcl)
 
reset
public void reset()
 
trimEdits
protected void trimEdits(int from,
                         int to)
- Overrides:
 trimEdits in class UndoManager
 
 
undo
public void undo()
          throws CannotUndoException
- Specified by:
 undo in interface UndoableEdit- Overrides:
 undo in class UndoManager
 
- Throws:
 CannotUndoException
 
undoableEditHappened
public void undoableEditHappened(UndoableEditEvent uee)
- Specified by:
 undoableEditHappened in interface UndoableEditListener- Overrides:
 undoableEditHappened in class UndoManager