public class ComboBoxAdaptor extends AbstractAutoCompleteAdaptor implements java.awt.event.ActionListener
Constructor and Description |
---|
ComboBoxAdaptor(javax.swing.JComboBox comboBox)
Creates a new ComobBoxAdaptor for the given combobox.
|
Modifier and Type | Method and Description |
---|---|
void |
actionPerformed(java.awt.event.ActionEvent actionEvent)
Implementation side effect - do not invoke.
|
java.lang.Object |
getItem(int index)
Returns the item at a given index.
|
int |
getItemCount()
Returns the number of items in the list.
|
java.lang.Object |
getSelectedItem()
Returns the currently selected item.
|
javax.swing.text.JTextComponent |
getTextComponent()
Returns the text component that is being used for the automatic completion.
|
void |
setSelectedItem(java.lang.Object item)
Sets the selected item.
|
getSelectedItemAsString, listContainsSelectedItem, markEntireText, markText, setSelectedItemAsString
public ComboBoxAdaptor(javax.swing.JComboBox comboBox)
comboBox
- the combobox that should be adaptedpublic void actionPerformed(java.awt.event.ActionEvent actionEvent)
actionPerformed
in interface java.awt.event.ActionListener
actionEvent
- -public int getItemCount()
AbstractAutoCompleteAdaptor
getItemCount
in class AbstractAutoCompleteAdaptor
public java.lang.Object getItem(int index)
AbstractAutoCompleteAdaptor
0<=index<getItemCount()
.getItem
in class AbstractAutoCompleteAdaptor
index
- the index of the item that is to be returnedindex
public void setSelectedItem(java.lang.Object item)
AbstractAutoCompleteAdaptor
setSelectedItem
in class AbstractAutoCompleteAdaptor
item
- the item that is to be selectedpublic java.lang.Object getSelectedItem()
AbstractAutoCompleteAdaptor
getSelectedItem
in class AbstractAutoCompleteAdaptor
public javax.swing.text.JTextComponent getTextComponent()
AbstractAutoCompleteAdaptor
getTextComponent
in class AbstractAutoCompleteAdaptor