org.jfree.ui

Class JTextObserver

public final class JTextObserver extends Object implements FocusListener

An observer that selects all the text when a field gains the focus.

Author: Thomas Morgner

Method Summary
static voidaddTextComponent(JTextComponent t)
Adds this instance as a listener for the specified text component.
voidfocusGained(FocusEvent e)
Selects all the text when a field gains the focus.
voidfocusLost(FocusEvent e)
Deselects the text when a field loses the focus.
static JTextObservergetInstance()
Returns the single instance.
static voidremoveTextComponent(JTextComponent t)
Removes this instance as a listener for the specified text component.

Method Detail

addTextComponent

public static void addTextComponent(JTextComponent t)
Adds this instance as a listener for the specified text component.

Parameters: t the text component.

focusGained

public void focusGained(FocusEvent e)
Selects all the text when a field gains the focus.

Parameters: e the focus event.

focusLost

public void focusLost(FocusEvent e)
Deselects the text when a field loses the focus.

Parameters: e the event.

getInstance

public static JTextObserver getInstance()
Returns the single instance.

Returns: The single instance.

removeTextComponent

public static void removeTextComponent(JTextComponent t)
Removes this instance as a listener for the specified text component.

Parameters: t the text component.