public class TextComponentAdaptor extends AbstractAutoCompleteAdaptor
| Constructor and Description |
|---|
TextComponentAdaptor(JTextComponent textComponent,
List<?> items)
Creates a new TextComponentAdaptor 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.
|
getSelectedItemAsString, listContainsSelectedItem, markEntireText, markText, setSelectedItemAsStringpublic TextComponentAdaptor(JTextComponent textComponent, List<?> items)
items - a List that contains the items that are used for
automatic completiontextComponent - the text component that will be used automatic
completionpublic 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 © 2017. All Rights Reserved.