|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectjavax.swing.plaf.basic.BasicComboBoxEditor
org.ceryle.ui.PredictiveComboBoxEditor
public class PredictiveComboBoxEditor
Extends the BasicComboBoxEditor to provide "predictive" behaviour,
where a subset of a backing list (a SetModel)
is displayed by typing in the initial characters of a word or phrase.
The list is dynamically modified to list all items from the backing
list that begin with the current characters in the editor.
setModel(ListModel).
SetModel and
sorted using its sort() method. This assumes all items comply
with the Comparable interface. If any item in the
backing list is not a String, its Object.toString()
method is used for comparison.
SetModel| Nested Class Summary |
|---|
| Nested classes/interfaces inherited from class javax.swing.plaf.basic.BasicComboBoxEditor |
|---|
BasicComboBoxEditor.UIResource |
| Field Summary |
|---|
| Fields inherited from class javax.swing.plaf.basic.BasicComboBoxEditor |
|---|
editor |
| Constructor Summary | |
|---|---|
PredictiveComboBoxEditor(JComboBox box)
Constructor with the parent JComboBox. |
|
| Method Summary | |
|---|---|
boolean |
isValidCharacter(char c)
Returns true if char c is a letter, digit, the Underscore ('_'), Period ('.'), or Dash ('-') character. |
void |
setItem(Object anObject)
Set the item that should be edited. |
void |
setModel(ListModel model)
Sets the backing list to a copy of the contents of the provided ListModel. |
static boolean |
setPrototypeDisplayValue(JComboBox combobox)
A static utility method that sets the prototype display value used to calculate the size of the display for the provided JComboBox. |
| Methods inherited from class javax.swing.plaf.basic.BasicComboBoxEditor |
|---|
addActionListener, focusGained, focusLost, getEditorComponent, getItem, removeActionListener, selectAll |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public PredictiveComboBoxEditor(JComboBox box)
| Method Detail |
|---|
public void setModel(ListModel model)
public void setItem(Object anObject)
setItem in interface ComboBoxEditorsetItem in class BasicComboBoxEditorpublic static boolean setPrototypeDisplayValue(JComboBox combobox)
If the JComboBox has no items or its FontMetrics can't be obtained (e.g., it is not visible), this method will have no effect.
public boolean isValidCharacter(char c)
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||