|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.jdesktop.swingx.autocomplete.AbstractComponentAdaptor
org.jdesktop.swingx.autocomplete.ListAdaptor
public class ListAdaptor
An implementation of the AbstractComponentAdaptor that is suitable for a JList in conjunction with a JTextComponent.
Constructor Summary | |
---|---|
ListAdaptor(javax.swing.JList list,
javax.swing.text.JTextComponent textComponent)
Creates a new JListAdaptor 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. |
void |
valueChanged(javax.swing.event.ListSelectionEvent listSelectionEvent)
Implementation side effect - do not invoke. |
Methods inherited from class org.jdesktop.swingx.autocomplete.AbstractComponentAdaptor |
---|
listContainsSelectedItem, markEntireText, markText |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public ListAdaptor(javax.swing.JList list, javax.swing.text.JTextComponent textComponent)
list
- the list that contains the items that are used for automatic
completiontextComponent
- the text component that will be used automatic
completionMethod Detail |
---|
public void valueChanged(javax.swing.event.ListSelectionEvent listSelectionEvent)
valueChanged
in interface javax.swing.event.ListSelectionListener
listSelectionEvent
- -public java.lang.Object getSelectedItem()
AbstractComponentAdaptor
getSelectedItem
in class AbstractComponentAdaptor
public int getItemCount()
AbstractComponentAdaptor
getItemCount
in class AbstractComponentAdaptor
public java.lang.Object getItem(int index)
AbstractComponentAdaptor
0<=index<getItemCount()
.
getItem
in class AbstractComponentAdaptor
index
- the index of the item that is to be returned
index
public void setSelectedItem(java.lang.Object item)
AbstractComponentAdaptor
setSelectedItem
in class AbstractComponentAdaptor
item
- the item that is to be selectedpublic javax.swing.text.JTextComponent getTextComponent()
AbstractComponentAdaptor
getTextComponent
in class AbstractComponentAdaptor
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |