com.isti.util.gui
Class JTextFieldComboBoxEditor

java.lang.Object
  extended bycom.isti.util.gui.JTextFieldComboBoxEditor
All Implemented Interfaces:
javax.swing.ComboBoxEditor

public class JTextFieldComboBoxEditor
extends java.lang.Object
implements javax.swing.ComboBoxEditor

An implementation of a ComboBoxEditor that uses a JTextField.


Field Summary
static int DEFAULT_COLUMNS
          The default number of columns.
 
Constructor Summary
JTextFieldComboBoxEditor()
          Creates the ComboBoxEditor with a new text field.
JTextFieldComboBoxEditor(javax.swing.JTextField textField)
          Creates the ComboBoxEditor with the specified text field.
 
Method Summary
 void addActionListener(java.awt.event.ActionListener actionListener)
          Add an ActionListener.
 java.awt.Component getEditorComponent()
          Return the component that should be added to the tree hierarchy for this editor.
 java.lang.Object getItem()
          Return the edited item.
 javax.swing.JTextField getTextField()
          Gets the text field.
 void removeActionListener(java.awt.event.ActionListener actionListener)
          Remove an ActionListener.
 void selectAll()
          Ask the editor to start editing and to select everything.
 void setItem(java.lang.Object anObject)
          Set the item that should be edited.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

DEFAULT_COLUMNS

public static final int DEFAULT_COLUMNS
The default number of columns.

See Also:
Constant Field Values
Constructor Detail

JTextFieldComboBoxEditor

public JTextFieldComboBoxEditor()
Creates the ComboBoxEditor with a new text field.


JTextFieldComboBoxEditor

public JTextFieldComboBoxEditor(javax.swing.JTextField textField)
Creates the ComboBoxEditor with the specified text field. If the number of columns was not specified, the default is used.

Parameters:
textField - the text field.
See Also:
DEFAULT_COLUMNS
Method Detail

addActionListener

public void addActionListener(java.awt.event.ActionListener actionListener)
Add an ActionListener. An action event is generated when the edited item changes.

Specified by:
addActionListener in interface javax.swing.ComboBoxEditor
Parameters:
actionListener - the action listener to add.

getEditorComponent

public java.awt.Component getEditorComponent()
Return the component that should be added to the tree hierarchy for this editor.

Specified by:
getEditorComponent in interface javax.swing.ComboBoxEditor
Returns:
the editor component.

getItem

public java.lang.Object getItem()
Return the edited item.

Specified by:
getItem in interface javax.swing.ComboBoxEditor
Returns:
the edited item.

getTextField

public javax.swing.JTextField getTextField()
Gets the text field.

Returns:
the text field.

removeActionListener

public void removeActionListener(java.awt.event.ActionListener actionListener)
Remove an ActionListener.

Specified by:
removeActionListener in interface javax.swing.ComboBoxEditor
Parameters:
actionListener - the action listener to remove.

selectAll

public void selectAll()
Ask the editor to start editing and to select everything.

Specified by:
selectAll in interface javax.swing.ComboBoxEditor

setItem

public void setItem(java.lang.Object anObject)
Set the item that should be edited. Cancel any editing if necessary.

Specified by:
setItem in interface javax.swing.ComboBoxEditor
Parameters:
anObject - the item that should be edited.