Groovy 2.2.0

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 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(PropertyChangeListener pcl)

void die()

void discardAllEdits()

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

boolean hasChanged()

void redo()

protected void redoTo(UndoableEdit edit)

void removePropertyChangeListener(PropertyChangeListener pcl)

void reset()

protected void trimEdits(int from, int to)

void undo()

void undoableEditHappened(UndoableEditEvent uee)

 
Methods inherited from class UndoManager
setLimit, getRedoPresentationName, getUndoPresentationName, addEdit, canRedo, canUndo, undo, undoableEditHappened, redo, getUndoOrRedoPresentationName, canUndoOrRedo, discardAllEdits, getLimit, undoOrRedo, toString, end, isSignificant, isInProgress, getPresentationName, die, replaceEdit, wait, wait, wait, equals, hashCode, getClass, notify, notifyAll
 
Methods inherited from class CompoundEdit
getRedoPresentationName, getUndoPresentationName, isSignificant, isInProgress, addEdit, canRedo, canUndo, undo, getPresentationName, die, redo, toString, end, replaceEdit, wait, wait, wait, equals, hashCode, getClass, notify, notifyAll
 

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

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


hasChanged

public boolean hasChanged()


redo

public void redo()


redoTo

protected void redoTo(UndoableEdit edit)


removePropertyChangeListener

public void removePropertyChangeListener(PropertyChangeListener pcl)


reset

public void reset()


trimEdits

protected void trimEdits(int from, int to)


undo

public void undo()


undoableEditHappened

public void undoableEditHappened(UndoableEditEvent uee)


 

Copyright © 2003-2013 The Codehaus. All rights reserved.