arlut.csd.ganymede.client
Class JInvidChooserFieldEditor

java.lang.Object
  |
  +--java.awt.event.KeyAdapter
        |
        +--arlut.csd.ganymede.client.JInvidChooserFieldEditor
All Implemented Interfaces:
java.awt.event.ActionListener, javax.swing.ComboBoxEditor, java.util.EventListener, java.awt.event.KeyListener

class JInvidChooserFieldEditor
extends java.awt.event.KeyAdapter
implements javax.swing.ComboBoxEditor, java.awt.event.ActionListener

A combobox editor class to provide intelligent keyboard handling for the JInvidChooser scalar invid field gui component.


Field Summary
(package private)  java.util.Vector actionListeners
           
(package private)  javax.swing.JComboBox box
           
(package private)  arlut.csd.ganymede.client.JInvidChooser chooser
           
(package private)  java.lang.Object curItem
           
(package private) static boolean debug
           
(package private)  int lastGoodIndex
           
(package private)  boolean lastGoodMatched
           
(package private)  java.lang.String lastGoodString
           
(package private)  javax.swing.JTextField theField
           
 
Constructor Summary
JInvidChooserFieldEditor(arlut.csd.ganymede.client.JInvidChooser chooser)
           
 
Method Summary
 void actionPerformed(java.awt.event.ActionEvent e)
          Handle the user hitting return in the editable area..
 void addActionListener(java.awt.event.ActionListener l)
           
 java.awt.Component getEditorComponent()
           
 java.lang.Object getItem()
           
 void keyReleased(java.awt.event.KeyEvent ke)
          Tap into the text field's key release to see if we can complete the user's selection.
 void removeActionListener(java.awt.event.ActionListener l)
           
 void selectAll()
           
 void setItem(java.lang.Object anObject)
           
 
Methods inherited from class java.awt.event.KeyAdapter
keyPressed, keyTyped
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

debug

static final boolean debug
See Also:
Constant Field Values

theField

javax.swing.JTextField theField

curItem

java.lang.Object curItem

box

javax.swing.JComboBox box

chooser

arlut.csd.ganymede.client.JInvidChooser chooser

actionListeners

java.util.Vector actionListeners

lastGoodString

java.lang.String lastGoodString

lastGoodMatched

boolean lastGoodMatched

lastGoodIndex

int lastGoodIndex
Constructor Detail

JInvidChooserFieldEditor

public JInvidChooserFieldEditor(arlut.csd.ganymede.client.JInvidChooser chooser)
Method Detail

setItem

public void setItem(java.lang.Object anObject)
Specified by:
setItem in interface javax.swing.ComboBoxEditor

getEditorComponent

public java.awt.Component getEditorComponent()
Specified by:
getEditorComponent in interface javax.swing.ComboBoxEditor

getItem

public java.lang.Object getItem()
Specified by:
getItem in interface javax.swing.ComboBoxEditor

selectAll

public void selectAll()
Specified by:
selectAll in interface javax.swing.ComboBoxEditor

addActionListener

public void addActionListener(java.awt.event.ActionListener l)
Specified by:
addActionListener in interface javax.swing.ComboBoxEditor

removeActionListener

public void removeActionListener(java.awt.event.ActionListener l)
Specified by:
removeActionListener in interface javax.swing.ComboBoxEditor

keyReleased

public void keyReleased(java.awt.event.KeyEvent ke)

Tap into the text field's key release to see if we can complete the user's selection. Note that we are doing this without synchronizing on the text field's own user interface.. to do this properly, we might ought to be doing this with a document model on the text field, but this works ok. Since we're keying on key release, we can expect to be called after the text field has processed the key press.

Specified by:
keyReleased in interface java.awt.event.KeyListener
Overrides:
keyReleased in class java.awt.event.KeyAdapter

actionPerformed

public void actionPerformed(java.awt.event.ActionEvent e)

Handle the user hitting return in the editable area.. if they hit return without a reasonable value, revert the combo.

Specified by:
actionPerformed in interface java.awt.event.ActionListener