|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectptolemy.gui.UndoListener
public class UndoListener
An Undo/Redo listener for use with a JTextComponent.
A convenience constructor has been provided such that a caller can immediately have default shortcut key mappings for undo/redo actions on the text component
| Red (cx) |
| Yellow (cxh) |
| Nested Class Summary | |
|---|---|
protected class |
UndoListener.RedoAction
Peform the redo action. |
protected class |
UndoListener.UndoAction
Perform the undo action. |
| Field Summary | |
|---|---|
protected UndoListener.RedoAction |
_redoAction
The redo action. |
protected javax.swing.undo.UndoManager |
_undo
The undo manager. |
protected UndoListener.UndoAction |
_undoAction
The undo action. |
| Constructor Summary | |
|---|---|
UndoListener()
Construct an undo listener. |
|
UndoListener(javax.swing.text.JTextComponent textArea)
Construct an undo listener with default key mappings. |
|
| Method Summary | |
|---|---|
void |
undoableEditHappened(javax.swing.event.UndoableEditEvent event)
Remember the edit and update the action state. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
protected UndoListener.UndoAction _undoAction
protected UndoListener.RedoAction _redoAction
protected javax.swing.undo.UndoManager _undo
| Constructor Detail |
|---|
public UndoListener()
This constructor allows simple usage without setting up key mapping automatically (it is then the responsibilty of the caller to provide a mechanism for invoking the undo and redo actions.)
public UndoListener(javax.swing.text.JTextComponent textArea)
A typical usage pattern would be:
JTextArea textArea = new JTextArea("testing");
textArea.getDocument().addUndoableEditListener(new UndoListener(textArea));
textArea - the text component that is being listened to
and upon which undo/redo actions will be performed| Method Detail |
|---|
public void undoableEditHappened(javax.swing.event.UndoableEditEvent event)
undoableEditHappened in interface javax.swing.event.UndoableEditListenerevent - The event that occurred.
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||