public class CompoundUndoManager
extends javax.swing.undo.UndoManager
implements javax.swing.event.UndoableEditListener, javax.swing.event.DocumentListener
Constructor and Description |
---|
CompoundUndoManager(HighlightedDocument doc,
java.lang.Runnable updateCallback) |
Modifier and Type | Method and Description |
---|---|
void |
changedUpdate(javax.swing.event.DocumentEvent e) |
void |
discardAllEdits() |
void |
insertUpdate(javax.swing.event.DocumentEvent e)
Updates to the Document as a result of Undo/Redo will cause the Caret to
be repositioned
|
void |
redo()
Add a DocumentListener before the redo is done so we can position the
Caret correctly as each edit is redone.
|
void |
removeUpdate(javax.swing.event.DocumentEvent e) |
void |
undo()
Add a DocumentListener before the undo is done so we can position the
Caret correctly as each edit is undone.
|
void |
undoableEditHappened(javax.swing.event.UndoableEditEvent e)
Whenever an UndoableEdit happens the edit will either be absorbed by the
current compound edit or a new compound edit will be started
|
void |
updateCursorPosition() |
addEdit, canRedo, canUndo, canUndoOrRedo, editToBeRedone, editToBeUndone, end, getLimit, getRedoPresentationName, getUndoOrRedoPresentationName, getUndoPresentationName, redoTo, setLimit, toString, trimEdits, trimForLimit, undoOrRedo, undoTo
public CompoundUndoManager(HighlightedDocument doc, java.lang.Runnable updateCallback)
public void undo()
undo
in interface javax.swing.undo.UndoableEdit
undo
in class javax.swing.undo.UndoManager
public void redo()
redo
in interface javax.swing.undo.UndoableEdit
redo
in class javax.swing.undo.UndoManager
public void discardAllEdits()
discardAllEdits
in class javax.swing.undo.UndoManager
public void updateCursorPosition()
public void undoableEditHappened(javax.swing.event.UndoableEditEvent e)
undoableEditHappened
in interface javax.swing.event.UndoableEditListener
undoableEditHappened
in class javax.swing.undo.UndoManager
public void insertUpdate(javax.swing.event.DocumentEvent e)
insertUpdate
in interface javax.swing.event.DocumentListener
public void removeUpdate(javax.swing.event.DocumentEvent e)
removeUpdate
in interface javax.swing.event.DocumentListener
public void changedUpdate(javax.swing.event.DocumentEvent e)
changedUpdate
in interface javax.swing.event.DocumentListener