|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.jdesktop.swingx.autocomplete.AutoCompleteComboBoxEditor
public class AutoCompleteComboBoxEditor
Wrapper around the combobox editor that translates combobox items into strings. The methods setItem and getItem are modified to account for the string conversion.
This is necessary for those cases where the combobox items have no useful toString() method and a custom ObjectToStringConverter is used.
If we do not do this, the interaction between ComboBoxEditor and JComboBox will result in firing ActionListener events with the string value of ComboBoxEditor as the currently selected value.
Constructor Summary | |
---|---|
AutoCompleteComboBoxEditor(ComboBoxEditor wrapped,
ObjectToStringConverter stringConverter)
Creates a new AutoCompleteComboBoxEditor. |
Method Summary | |
---|---|
void |
addActionListener(ActionListener l)
Add an ActionListener. |
Component |
getEditorComponent()
Return the component that should be added to the tree hierarchy for this editor |
Object |
getItem()
Return the edited item |
void |
removeActionListener(ActionListener l)
Remove an ActionListener |
void |
selectAll()
Ask the editor to start editing and to select everything |
void |
setItem(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 |
Constructor Detail |
---|
public AutoCompleteComboBoxEditor(ComboBoxEditor wrapped, ObjectToStringConverter stringConverter)
wrapped
- the original ComboBoxEditor to be wrappedstringConverter
- the converter to use to convert items into their
string representation.Method Detail |
---|
public Component getEditorComponent()
javax.swing.ComboBoxEditor
getEditorComponent
in interface ComboBoxEditor
public void setItem(Object anObject)
javax.swing.ComboBoxEditor
setItem
in interface ComboBoxEditor
public Object getItem()
javax.swing.ComboBoxEditor
getItem
in interface ComboBoxEditor
public void selectAll()
javax.swing.ComboBoxEditor
selectAll
in interface ComboBoxEditor
public void addActionListener(ActionListener l)
javax.swing.ComboBoxEditor
addActionListener
in interface ComboBoxEditor
public void removeActionListener(ActionListener l)
javax.swing.ComboBoxEditor
removeActionListener
in interface ComboBoxEditor
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |