public class ListAdaptor extends AbstractAutoCompleteAdaptor implements ListSelectionListener
| Constructor and Description |
|---|
ListAdaptor(JList list,
JTextComponent textComponent)
Creates a new JListAdaptor for the given list and text component.
|
ListAdaptor(JList list,
JTextComponent textComponent,
ObjectToStringConverter stringConverter)
Creates a new JListAdaptor for the given list and text component.
|
| Modifier and Type | Method and Description |
|---|---|
Object |
getItem(int index)
Returns the item at a given index.
|
int |
getItemCount()
Returns the number of items in the list.
|
Object |
getSelectedItem()
Returns the currently selected item.
|
JTextComponent |
getTextComponent()
Returns the text component that is being used for the automatic completion.
|
void |
setSelectedItem(Object item)
Sets the selected item.
|
void |
valueChanged(ListSelectionEvent listSelectionEvent)
Implementation side effect - do not invoke.
|
getSelectedItemAsString, listContainsSelectedItem, markEntireText, markText, setSelectedItemAsStringpublic ListAdaptor(JList list, JTextComponent textComponent)
list - the list that contains the items that are used for automatic
completiontextComponent - the text component that will be used automatic
completionpublic ListAdaptor(JList list, JTextComponent textComponent, ObjectToStringConverter stringConverter)
list - the list that contains the items that are used for automatic
completiontextComponent - the text component that will be used automatic
completionstringConverter - the converter used to transform items to stringspublic void valueChanged(ListSelectionEvent listSelectionEvent)
valueChanged in interface ListSelectionListenerlistSelectionEvent - -public Object getSelectedItem()
AbstractAutoCompleteAdaptorgetSelectedItem in class AbstractAutoCompleteAdaptorpublic int getItemCount()
AbstractAutoCompleteAdaptorgetItemCount in class AbstractAutoCompleteAdaptorpublic Object getItem(int index)
AbstractAutoCompleteAdaptor0<=index<getItemCount().getItem in class AbstractAutoCompleteAdaptorindex - the index of the item that is to be returnedindexpublic void setSelectedItem(Object item)
AbstractAutoCompleteAdaptorsetSelectedItem in class AbstractAutoCompleteAdaptoritem - the item that is to be selectedpublic JTextComponent getTextComponent()
AbstractAutoCompleteAdaptorgetTextComponent in class AbstractAutoCompleteAdaptorCopyright © 2014. All rights reserved.