org.tbee.swing
Class UndoableTextFieldAdapter
java.lang.Object
java.awt.event.KeyAdapter
org.tbee.swing.UndoableTextFieldAdapter
- All Implemented Interfaces:
- KeyListener, EventListener, UndoableEditListener
public class UndoableTextFieldAdapter
- extends KeyAdapter
- implements UndoableEditListener
This class is used to implement undo and redo on all textfields.
One could use the UndoManager which can handle all kinds of objects, like trees:
UndoableTree tree = new UndoableTree(rootNode);
UndoManager manager = new UndoManager();
tree.addUndoableEditListener(manager);
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
SOURCECODE_VERSION
public static final String SOURCECODE_VERSION
- Standard variable for determining version of a class file.
- See Also:
- Constant Field Values
UndoableTextFieldAdapter
public UndoableTextFieldAdapter()
undoableEditHappened
public void undoableEditHappened(UndoableEditEvent e)
- Specified by:
undoableEditHappened in interface UndoableEditListener
keyPressed
public void keyPressed(KeyEvent e)
- Specified by:
keyPressed in interface KeyListener- Overrides:
keyPressed in class KeyAdapter
redo
public void redo()
undo
public void undo()
clear
public void clear()
- clear
install
public static UndoableTextFieldAdapter install(JTextField jTextField)
- Parameters:
jTextField -
- Returns:
install
public static UndoableTextFieldAdapter install(JFormattedTextField jTextField)
- Parameters:
jTextField -
- Returns:
install
public static UndoableTextFieldAdapter install(JTextArea jTextField)
- Parameters:
jTextField -
- Returns:
Copyright © 2012 KnowledgePlaza. All Rights Reserved.