Groovy Documentation

com.wordpress.tipsforjava.swing
[Java] Class CompoundUndoManager

java.lang.Object
  javax.swing.undo.AbstractUndoableEdit
      javax.swing.undo.CompoundEdit
          javax.swing.undo.UndoManager
              com.wordpress.tipsforjava.swing.CompoundUndoManager
All Implemented Interfaces:
UndoableEditListener, DocumentListener

public class CompoundUndoManager
extends UndoManager

This class will merge individual edits into a single larger edit. That is, characters entered sequentially will be grouped together and undone as a group. Any attribute changes will be considered as part of the group and will therefore be undone when the group is undone.

Authors:
Rob Camick
Darryl Burke


Nested Class Summary
class CompoundUndoManager.MyCompoundEdit

class CompoundUndoManager.RedoAction

class CompoundUndoManager.UndoAction

 
Field Summary
private CompoundEdit compoundEdit

private int lastLength

private int lastOffset

private CompoundUndoManager.RedoAction redoAction

private JTextComponent textComponent

private CompoundUndoManager.UndoAction undoAction

private UndoManager undoManager

 
Constructor Summary
CompoundUndoManager(JTextComponent textComponent)

 
Method Summary
void changedUpdate(DocumentEvent e)

Action getRedoAction()

Action getUndoAction()

void insertUpdate(DocumentEvent e)

void redo()

void removeUpdate(DocumentEvent e)

private CompoundEdit startCompoundEdit(UndoableEdit anEdit)

void undo()

void undoableEditHappened(UndoableEditEvent e)

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

Field Detail

compoundEdit

private CompoundEdit compoundEdit


lastLength

private int lastLength


lastOffset

private int lastOffset


redoAction

private CompoundUndoManager.RedoAction redoAction


textComponent

private JTextComponent textComponent


undoAction

private CompoundUndoManager.UndoAction undoAction


undoManager

private UndoManager undoManager


 
Constructor Detail

CompoundUndoManager

public CompoundUndoManager(JTextComponent textComponent)


 
Method Detail

changedUpdate

public void changedUpdate(DocumentEvent e)


getRedoAction

public Action getRedoAction()


getUndoAction

public Action getUndoAction()


insertUpdate

public void insertUpdate(DocumentEvent e)


redo

public void redo()


removeUpdate

public void removeUpdate(DocumentEvent e)


startCompoundEdit

private CompoundEdit startCompoundEdit(UndoableEdit anEdit)


undo

public void undo()


undoableEditHappened

public void undoableEditHappened(UndoableEditEvent e)


 

Groovy Documentation