public class TextComponentAdaptor extends AbstractAutoCompleteAdaptor
Constructor | Description |
---|---|
TextComponentAdaptor(JTextComponent textComponent,
List<?> items) |
Creates a new TextComponentAdaptor for the given list and text
component.
|
Modifier and Type | Method | 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, setSelectedItemAsString
public 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()
AbstractAutoCompleteAdaptor
getSelectedItem
in class AbstractAutoCompleteAdaptor
public int getItemCount()
AbstractAutoCompleteAdaptor
getItemCount
in class AbstractAutoCompleteAdaptor
public 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(Object item)
AbstractAutoCompleteAdaptor
setSelectedItem
in class AbstractAutoCompleteAdaptor
item
- the item that is to be selectedpublic JTextComponent getTextComponent()
AbstractAutoCompleteAdaptor
getTextComponent
in class AbstractAutoCompleteAdaptor
Copyright © 2018. All rights reserved.