|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object net.atlanticbb.tantlinger.ui.text.CompoundUndoManager
public class CompoundUndoManager
Manages compound undoable edits. Before an undoable edit happens on a particular document, you should call the static method CompoundUndoManager.beginCompoundEdit(doc) Conversely after an undoable edit happens on a particular document, you shoulc call the static method CompoundUndoManager.beginCompoundEdit(doc) For either of these methods to work, you must add an instance of CompoundUndoManager as a document listener... e.g doc.addUndoableEditListener(new CompoundUndoManager(doc, new UndoManager()); Note that each CompoundUndoManager should have its own UndoManager.
Field Summary | |
---|---|
static javax.swing.Action |
REDO
Static undo action that works across all documents with a CompoundUndoManager registered as an UndoableEditListener |
static javax.swing.Action |
UNDO
Static undo action that works across all documents with a CompoundUndoManager registered as an UndoableEditListener |
Constructor Summary | |
---|---|
CompoundUndoManager(javax.swing.text.Document doc)
Creates a new CompoundUndoManager |
|
CompoundUndoManager(javax.swing.text.Document doc,
javax.swing.undo.UndoManager um)
Creates a new CompoundUndoManager |
Method Summary | |
---|---|
protected void |
beginCompoundEdit()
|
static void |
beginCompoundEdit(javax.swing.text.Document doc)
Notifies the CompoundUndoManager for the specified Document that a compound edit is about to begin. |
static void |
discardAllEdits(javax.swing.text.Document doc)
Discards all edits for the specified Document |
protected void |
endCompoundEdit()
|
static void |
endCompoundEdit(javax.swing.text.Document doc)
Notifies the CompoundUndoManager for the specified Document that a compound edit is complete. |
static javax.swing.undo.UndoManager |
getUndoManagerForDocument(javax.swing.text.Document doc)
Gets the undo manager for a document that has a CompoundUndoManager as an UndoableEditListener |
protected static void |
registerDocument(javax.swing.text.Document doc,
CompoundUndoManager lst,
javax.swing.undo.UndoManager um)
|
void |
undoableEditHappened(javax.swing.event.UndoableEditEvent evt)
|
static void |
updateUndo(javax.swing.text.Document doc)
Updates the enabled states of the UNDO and REDO actions for the specified document |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
public static javax.swing.Action UNDO
public static javax.swing.Action REDO
Constructor Detail |
---|
public CompoundUndoManager(javax.swing.text.Document doc, javax.swing.undo.UndoManager um)
doc
- um
- The UndoManager to use for this documentpublic CompoundUndoManager(javax.swing.text.Document doc)
doc
- Method Detail |
---|
protected static void registerDocument(javax.swing.text.Document doc, CompoundUndoManager lst, javax.swing.undo.UndoManager um)
public static javax.swing.undo.UndoManager getUndoManagerForDocument(javax.swing.text.Document doc)
doc
-
public static void beginCompoundEdit(javax.swing.text.Document doc)
doc
- public static void endCompoundEdit(javax.swing.text.Document doc)
doc
- public static void updateUndo(javax.swing.text.Document doc)
doc
- public static void discardAllEdits(javax.swing.text.Document doc)
doc
- public void undoableEditHappened(javax.swing.event.UndoableEditEvent evt)
undoableEditHappened
in interface javax.swing.event.UndoableEditListener
protected void beginCompoundEdit()
protected void endCompoundEdit()
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |