Groovy Documentation

## groovy.ui.text
[Java] Class TextUndoManager

    java.lang.Object
      javax.swing.undo.AbstractUndoableEdit
          javax.swing.undo.CompoundEdit
              javax.swing.undo.UndoManager
                  groovy.ui.text.TextUndoManager

    public class TextUndoManager
    extends javax.swing.undo.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).

Authors:
  Evan "Hippy" Slatis

Constructor Summary
`TextUndoManager()` Creates a new instance of TextUndoManager.

Method Summary
`void` | `addPropertyChangeListener(java.beans.PropertyChangeListener pcl)`
`void` | `die()`
`void` | `discardAllEdits()`
`protected void` | `firePropertyChangeEvent(java.lang.String name, boolean oldValue, boolean newValue)`
`boolean` | `hasChanged()`
`void` | `redo()`
`protected void` | `redoTo(javax.swing.undo.UndoableEdit edit)`
`void` | `removePropertyChangeListener(java.beans.PropertyChangeListener pcl)`
`void` | `reset()`
`protected void` | `trimEdits(int from, int to)`
`void` | `undo()`
`void` | `undoableEditHappened(javax.swing.event.UndoableEditEvent uee)`

Methods inherited from class javax.swing.undo.UndoManager

javax.swing.undo.UndoManager#canUndoOrRedo(), javax.swing.undo.UndoManager#getUndoOrRedoPresentationName(), javax.swing.undo.UndoManager#setLimit(int), javax.swing.undo.UndoManager#undoOrRedo(), javax.swing.undo.UndoManager#getLimit(), javax.swing.undo.UndoManager#discardAllEdits(), javax.swing.undo.UndoManager#canRedo(), javax.swing.undo.UndoManager#undoableEditHappened(javax.swing.event.UndoableEditEvent), javax.swing.undo.UndoManager#canUndo(), javax.swing.undo.UndoManager#getUndoPresentationName(), javax.swing.undo.UndoManager#getRedoPresentationName(), javax.swing.undo.UndoManager#addEdit(javax.swing.undo.UndoableEdit), javax.swing.undo.UndoManager#undo(), javax.swing.undo.UndoManager#redo(), javax.swing.undo.UndoManager#toString(), javax.swing.undo.UndoManager#end(), javax.swing.undo.UndoManager#die(), javax.swing.undo.UndoManager#isSignificant(), javax.swing.undo.UndoManager#getPresentationName(), javax.swing.undo.UndoManager#isInProgress(), javax.swing.undo.UndoManager#replaceEdit(javax.swing.undo.UndoableEdit), javax.swing.undo.UndoManager#wait(long), javax.swing.undo.UndoManager#wait(long, int), javax.swing.undo.UndoManager#wait(), javax.swing.undo.UndoManager#equals(java.lang.Object), javax.swing.undo.UndoManager#hashCode(), javax.swing.undo.UndoManager#getClass(), javax.swing.undo.UndoManager#notify(), javax.swing.undo.UndoManager#notifyAll()

Methods inherited from class javax.swing.undo.CompoundEdit

javax.swing.undo.CompoundEdit#canRedo(), javax.swing.undo.CompoundEdit#die(), javax.swing.undo.CompoundEdit#canUndo(), javax.swing.undo.CompoundEdit#isSignificant(), javax.swing.undo.CompoundEdit#getPresentationName(), javax.swing.undo.CompoundEdit#getUndoPresentationName(), javax.swing.undo.CompoundEdit#getRedoPresentationName(), javax.swing.undo.CompoundEdit#addEdit(javax.swing.undo.UndoableEdit), javax.swing.undo.CompoundEdit#undo(), javax.swing.undo.CompoundEdit#redo(), javax.swing.undo.CompoundEdit#isInProgress(), javax.swing.undo.CompoundEdit#toString(), javax.swing.undo.CompoundEdit#end(), javax.swing.undo.CompoundEdit#replaceEdit(javax.swing.undo.UndoableEdit), javax.swing.undo.CompoundEdit#wait(long), javax.swing.undo.CompoundEdit#wait(long, int), javax.swing.undo.CompoundEdit#wait(), javax.swing.undo.CompoundEdit#equals(java.lang.Object), javax.swing.undo.CompoundEdit#hashCode(), javax.swing.undo.CompoundEdit#getClass(), javax.swing.undo.CompoundEdit#notify(), javax.swing.undo.CompoundEdit#notifyAll()

Constructor Detail

### TextUndoManager

    public TextUndoManager()

  Creates a new instance of TextUndoManager.

Method Detail

### addPropertyChangeListener

    public void addPropertyChangeListener(java.beans.PropertyChangeListener pcl)

### die

    public void die()

### discardAllEdits

    public void discardAllEdits()

### firePropertyChangeEvent

    protected void firePropertyChangeEvent(java.lang.String name, boolean oldValue, boolean newValue)

### hasChanged

    public boolean hasChanged()

### redo

    public void redo()

### redoTo

    protected void redoTo(javax.swing.undo.UndoableEdit edit)

### removePropertyChangeListener

    public void removePropertyChangeListener(java.beans.PropertyChangeListener pcl)

### reset

    public void reset()

### trimEdits

    protected void trimEdits(int from, int to)

### undo

    public void undo()

### undoableEditHappened

    public void undoableEditHappened(javax.swing.event.UndoableEditEvent uee)

Groovy Documentation