|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectjavax.swing.AbstractListModel
org.jdesktop.swingx.combobox.ListComboBoxModel<E>
E - the type of elements maintained by the list backing this modelpublic class ListComboBoxModel<E>
A ComboBoxModel for Lists.
| Field Summary | |
|---|---|
protected List<E> |
data
A reference to the list backing this model. |
protected E |
selected
The currently selected item. |
static String |
UPDATE
A key used to notify the model that the backing List has changed. |
| Fields inherited from class javax.swing.AbstractListModel |
|---|
listenerList |
| Constructor Summary | |
|---|---|
ListComboBoxModel(List<E> list)
Creates a ListComboBoxModel backed by the supplied list. |
|
| Method Summary | |
|---|---|
void |
actionPerformed(ActionEvent evt)
Invoked when an action occurs. |
E |
getElementAt(int index)
Returns the value at the specified index. |
E |
getSelectedItem()
Returns the selected item |
int |
getSize()
Returns the length of the list. |
void |
setSelectedItem(Object item)
Set the selected item. |
| Methods inherited from class javax.swing.AbstractListModel |
|---|
addListDataListener, fireContentsChanged, fireIntervalAdded, fireIntervalRemoved, getListDataListeners, getListeners, removeListDataListener |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Methods inherited from interface javax.swing.ListModel |
|---|
addListDataListener, removeListDataListener |
| Field Detail |
|---|
public static final String UPDATE
List has changed.
protected final List<E> data
This model does not make a copy of the list, so any changes in the list without synchronizing the model may have drastic effects.
protected E selected
| Constructor Detail |
|---|
public ListComboBoxModel(List<E> list)
ListComboBoxModel backed by the supplied list.
list - the list backing this model
NullPointerException - if list is null| Method Detail |
|---|
public void setSelectedItem(Object item)
ListDataListeners that the contents have changed.
setSelectedItem in interface ComboBoxModelitem - the list object to select or null to clear the
selection
ClassCastException - if item is not of type Epublic E getSelectedItem()
getSelectedItem in interface ComboBoxModelnull if there is no selectionpublic E getElementAt(int index)
getElementAt in interface ListModelindex - the requested index
indexpublic int getSize()
getSize in interface ListModelpublic void actionPerformed(ActionEvent evt)
actionPerformed in interface ActionListener
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||