public abstract class AbstractAutoCompleteAdaptor extends Object
ComboBoxAdaptor
,
ListAdaptor
Modifier and Type | Field and Description |
---|---|
private String |
selectedItemAsString
the string representation in use for the currently selected item
|
Constructor and Description |
---|
AbstractAutoCompleteAdaptor() |
Modifier and Type | Method and Description |
---|---|
abstract Object |
getItem(int index)
Returns the item at a given index.
|
abstract int |
getItemCount()
Returns the number of items in the list.
|
abstract Object |
getSelectedItem()
Returns the currently selected item.
|
String |
getSelectedItemAsString()
Returns the string representation in use for the currently selected item.
|
abstract JTextComponent |
getTextComponent()
Returns the text component that is being used for the automatic completion.
|
boolean |
listContainsSelectedItem()
Returns true if the list contains the currently selected item.
|
void |
markEntireText()
Marks/selects the entire text that is displayed inside the text component.
|
void |
markText(int start)
Marks/selects the text that is displayed inside the text component starting from the
character with index start.
|
abstract void |
setSelectedItem(Object item)
Sets the selected item.
|
void |
setSelectedItemAsString(String itemAsString)
Sets the string representation in use for the currently selected item.
|
private String selectedItemAsString
public AbstractAutoCompleteAdaptor()
public abstract Object getSelectedItem()
public abstract void setSelectedItem(Object item)
item
- the item that is to be selectedpublic String getSelectedItemAsString()
public void setSelectedItemAsString(String itemAsString)
itemAsString
- the string representation in use for the currently selected itempublic abstract int getItemCount()
public abstract Object getItem(int index)
0<=index<getItemCount()
.index
- the index of the item that is to be returnedindex
public boolean listContainsSelectedItem()
public abstract JTextComponent getTextComponent()
public void markEntireText()
public void markText(int start)
start
- index of the first character that should be markedWebARTS Library Licensed Under the GNU - General Public License. Other Libraries licensed under their respective Open Source Licenses