|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.jdesktop.swingx.autocomplete.AbstractAutoCompleteAdaptor
org.jdesktop.swingx.autocomplete.TextComponentAdaptor
public class TextComponentAdaptor
An implementation of the AbstractAutoCompleteAdaptor that is suitable for a JTextComponent.
Constructor Summary | |
---|---|
TextComponentAdaptor(javax.swing.text.JTextComponent textComponent,
java.util.List<?> items)
Creates a new TextComponentAdaptor for the given list and text component. |
Method Summary | |
---|---|
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. |
Methods inherited from class org.jdesktop.swingx.autocomplete.AbstractAutoCompleteAdaptor |
---|
getSelectedItemAsString, listContainsSelectedItem, markEntireText, markText, setSelectedItemAsString |
Methods inherited from class java.lang.Object |
---|
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public TextComponentAdaptor(javax.swing.text.JTextComponent textComponent, java.util.List<?> items)
items
- a List that contains the items that are used for
automatic completiontextComponent
- the text component that will be used automatic
completionMethod Detail |
---|
public java.lang.Object getSelectedItem()
AbstractAutoCompleteAdaptor
getSelectedItem
in class AbstractAutoCompleteAdaptor
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 returned
index
public void setSelectedItem(java.lang.Object item)
AbstractAutoCompleteAdaptor
setSelectedItem
in class AbstractAutoCompleteAdaptor
item
- the item that is to be selectedpublic javax.swing.text.JTextComponent getTextComponent()
AbstractAutoCompleteAdaptor
getTextComponent
in class AbstractAutoCompleteAdaptor
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |