Class ComboBoxAdaptor
java.lang.Object
org.jdesktop.swingx.autocomplete.AbstractAutoCompleteAdaptor
org.jdesktop.swingx.autocomplete.ComboBoxAdaptor
- All Implemented Interfaces:
ActionListener, EventListener
An implementation of the AbstractAutoCompleteAdaptor that is suitable for JComboBox.
-
Field Summary
Fields -
Constructor Summary
ConstructorsConstructorDescriptionComboBoxAdaptor(JComboBox comboBox) Creates a new ComobBoxAdaptor for the given combobox. -
Method Summary
Modifier and TypeMethodDescriptionvoidactionPerformed(ActionEvent actionEvent) Implementation side effect - do not invoke.getItem(int index) Returns the item at a given index.intReturns the number of items in the list.Returns the currently selected item.Returns the text component that is being used for the automatic completion.voidsetSelectedItem(Object item) Sets the selected item.Methods inherited from class AbstractAutoCompleteAdaptor
getSelectedItemAsString, listContainsSelectedItem, markEntireText, markText, setSelectedItemAsString
-
Field Details
-
comboBox
the combobox being adapted
-
-
Constructor Details
-
ComboBoxAdaptor
Creates a new ComobBoxAdaptor for the given combobox.- Parameters:
comboBox- the combobox that should be adapted
-
-
Method Details
-
actionPerformed
Implementation side effect - do not invoke.- Specified by:
actionPerformedin interfaceActionListener- Parameters:
actionEvent- -
-
getItemCount
public int getItemCount()Description copied from class:AbstractAutoCompleteAdaptorReturns the number of items in the list.- Specified by:
getItemCountin classAbstractAutoCompleteAdaptor- Returns:
- the number of items in the list
-
getItem
Description copied from class:AbstractAutoCompleteAdaptorReturns the item at a given index. It is supposed that0<=index<getItemCount().- Specified by:
getItemin classAbstractAutoCompleteAdaptor- Parameters:
index- the index of the item that is to be returned- Returns:
- the item at the given
index
-
setSelectedItem
Description copied from class:AbstractAutoCompleteAdaptorSets the selected item.- Specified by:
setSelectedItemin classAbstractAutoCompleteAdaptor- Parameters:
item- the item that is to be selected
-
getSelectedItem
Description copied from class:AbstractAutoCompleteAdaptorReturns the currently selected item.- Specified by:
getSelectedItemin classAbstractAutoCompleteAdaptor- Returns:
- the selected item
-
getTextComponent
Description copied from class:AbstractAutoCompleteAdaptorReturns the text component that is being used for the automatic completion.- Specified by:
getTextComponentin classAbstractAutoCompleteAdaptor- Returns:
- the text component being used for the automatic completion
-