com.froses.widgets
Class MultiKeySelection

java.lang.Object
  extended bycom.froses.widgets.MultiKeySelection
All Implemented Interfaces:
java.awt.event.ActionListener, java.util.EventListener, javax.swing.JComboBox.KeySelectionManager

public class MultiKeySelection
extends java.lang.Object
implements javax.swing.JComboBox.KeySelectionManager, java.awt.event.ActionListener

The goal of this class is to provide a better JComboBox item selection adding the possibility to select an item typing your n first characters (not only the first).

This class constructs a search string concatenating the keyboard inputs. This string becomes null if:

To do the compare, the input string is lowercased and the accented characters are translated to unaccented characters.

To set this KeySelectionManager to a JComboBox you must use the JComboBox.setKeySelectionManager() method.

See Also:
Creation date: (22/03/01 08:55:00)

Field Summary
static int MAX_SEARCH_STRING
          Maximum search string length
 
Constructor Summary
MultiKeySelection()
          The constructor initializes Timer.
 
Method Summary
 void actionPerformed(java.awt.event.ActionEvent evt)
           The ActionListener implementation.
 int selectionForKey(char key, javax.swing.ComboBoxModel model)
          The KeySelectionManager implementation.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

MAX_SEARCH_STRING

public static final int MAX_SEARCH_STRING
Maximum search string length

See Also:
Constant Field Values
Constructor Detail

MultiKeySelection

public MultiKeySelection()
The constructor initializes Timer.

Method Detail

actionPerformed

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

The ActionListener implementation.

If enter is typed, the Timer and the search string are cancelled.

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

selectionForKey

public int selectionForKey(char key,
                           javax.swing.ComboBoxModel model)
The KeySelectionManager implementation.

Specified by:
selectionForKey in interface javax.swing.JComboBox.KeySelectionManager