groovy.ui.text
Class TextUndoManager

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

Field Summary
 StructuredEdit compoundEdit
           
 long firstModified
           
 UndoableEdit modificationMarker
           
 SwingPropertyChangeSupport propChangeSupport
           
 
Constructor Summary
TextUndoManager()
            Creates a new instance of TextUndoManager.
 
Method Summary
void addPropertyChangeListener(PropertyChangeListener pcl)
          
void die()
          
void discardAllEdits()
          
void firePropertyChangeEvent(String name, boolean oldValue, boolean newValue)
          
boolean hasChanged()
          
void redo()
          
void redoTo(UndoableEdit edit)
          
void removePropertyChangeListener(PropertyChangeListener pcl)
          
void reset()
          
void trimEdits(int from, int to)
          
void undo()
          
void undoableEditHappened(UndoableEditEvent uee)
          
 

Constructor Detail

TextUndoManager

public TextUndoManager()
Creates a new instance of TextUndoManager.


Method Detail

addPropertyChangeListener

public void addPropertyChangeListener(PropertyChangeListener pcl)


die

public void die()


discardAllEdits

public void discardAllEdits()


firePropertyChangeEvent

void firePropertyChangeEvent(String name, boolean oldValue, boolean newValue)


hasChanged

public boolean hasChanged()


redo

public void redo()


redoTo

void redoTo(UndoableEdit edit)


removePropertyChangeListener

public void removePropertyChangeListener(PropertyChangeListener pcl)


reset

public void reset()


trimEdits

void trimEdits(int from, int to)


undo

public void undo()


undoableEditHappened

public void undoableEditHappened(UndoableEditEvent uee)