|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object jwo.utils.gui.UndoHandler
public class UndoHandler
Deals with the 'undo' and 'redo' actions associated with a document. This handler should be passed the text component used to display the document so that it can use it to find the standard edit actions. Undo is also mapped onto ctrl-z and redo onto ctrl-y so that menu control is not necessary.
Constructor Summary | |
---|---|
UndoHandler(JTextComponent textComp)
Creates a handler to be attached to the given text component. |
|
UndoHandler(JTextComponent textComp,
boolean ignoreStyleChanges)
Creates a handler to be attached to the given text component. |
Method Summary | |
---|---|
void |
addRedoAction(Action newRedoAction)
Adds an external redo action to be notified when something is redone. |
void |
addUndoAction(Action newUndoAction)
Adds an external undo action to be notified when something is undone. |
boolean |
redoLastChange()
Redoes last undoable action. |
void |
undoableEditHappened(UndoableEditEvent e)
Responds to undoable edits by saving them in the undo manager. |
boolean |
undoLastChange()
Undoes last undoable action. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public UndoHandler(JTextComponent textComp)
textComp
- Text component associated with undo/redo actions.public UndoHandler(JTextComponent textComp, boolean ignoreStyleChanges)
ignoreStyleChanges
argument should be set to true if a
syntax highlighter is being used to handle style automatically. By
doing so, style changes are not included in the history of undoable/
redoable edit changes.
textComp
- Text component associated with undo/redo actions.ignoreStyleChanges
- If true, style changes to textComp
's
document are ignored.Method Detail |
---|
public void undoableEditHappened(UndoableEditEvent e)
undoableEditHappened
in interface UndoableEditListener
e
- Undoable edit event.public void addUndoAction(Action newUndoAction)
newUndoAction
- Additional undo action (e.g. menu item) to be notified when undo occurs.public void addRedoAction(Action newRedoAction)
newRedoAction
- Additional redo action (e.g. menu item) to be notified when redo occurs.public boolean undoLastChange()
public boolean redoLastChange()
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |