org.tbee.swing
Class UndoableTextFieldAdapter

java.lang.Object
  extended by java.awt.event.KeyAdapter
      extended by 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);


Field Summary
static String SOURCECODE_VERSION
          Standard variable for determining version of a class file.
 
Constructor Summary
UndoableTextFieldAdapter()
           
 
Method Summary
 void clear()
          clear
static UndoableTextFieldAdapter install(JFormattedTextField jTextField)
           
static UndoableTextFieldAdapter install(JTextArea jTextField)
           
static UndoableTextFieldAdapter install(JTextField jTextField)
           
 void keyPressed(KeyEvent e)
           
 void redo()
           
 void undo()
           
 void undoableEditHappened(UndoableEditEvent e)
           
 
Methods inherited from class java.awt.event.KeyAdapter
keyReleased, keyTyped
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

SOURCECODE_VERSION

public static final String SOURCECODE_VERSION
Standard variable for determining version of a class file.

See Also:
Constant Field Values
Constructor Detail

UndoableTextFieldAdapter

public UndoableTextFieldAdapter()
Method Detail

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.