|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectjavax.swing.AbstractListModel
jigcell.compare.ui.ListComboBoxModel
public class ListComboBoxModel
Combo box model that uses a list for storage.
Subclasses may safely inherit the following methods:
This code is licensed under the DARPA BioCOMP Open Source License. See LICENSE for more details.
Field Summary | |
---|---|
private java.util.List |
list
Items contained in this model |
private java.lang.Object |
selected
Currently selected item |
Fields inherited from class javax.swing.AbstractListModel |
---|
listenerList |
Constructor Summary | |
---|---|
ListComboBoxModel()
Creates a new combo box model with no initial values. |
|
ListComboBoxModel(java.util.List list)
Creates a new combo box model with initial values from a list. |
Method Summary | |
---|---|
void |
addElement(java.lang.Object item)
|
java.lang.Object |
getElementAt(int index)
|
int |
getIndexOf(java.lang.Object item)
Index of an item in this model or -1 if the item is not present. |
int |
getSelectedIndex()
The index of the selected item or -1 if no item is selected. |
java.lang.Object |
getSelectedItem()
|
int |
getSize()
|
void |
insertElementAt(java.lang.Object item,
int index)
|
void |
removeAll()
Removes all entries in this model. |
void |
removeElement(java.lang.Object item)
|
void |
removeElementAt(int index)
|
void |
replaceAll(java.util.List list)
Replaces all elements in this model with a new list. |
void |
setSelectedIndex(int index)
Sets the selected item by index. |
void |
setSelectedItem(java.lang.Object 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 |
---|
private java.util.List list
private java.lang.Object selected
Constructor Detail |
---|
public ListComboBoxModel()
public ListComboBoxModel(java.util.List list)
list
- Initial valuesMethod Detail |
---|
public void addElement(java.lang.Object item)
addElement
in interface javax.swing.MutableComboBoxModel
public java.lang.Object getElementAt(int index)
getElementAt
in interface javax.swing.ListModel
public int getIndexOf(java.lang.Object item)
item
- Itempublic int getSelectedIndex()
public java.lang.Object getSelectedItem()
getSelectedItem
in interface javax.swing.ComboBoxModel
public int getSize()
getSize
in interface javax.swing.ListModel
public void insertElementAt(java.lang.Object item, int index)
insertElementAt
in interface javax.swing.MutableComboBoxModel
public void removeAll()
public void removeElement(java.lang.Object item)
removeElement
in interface javax.swing.MutableComboBoxModel
public void removeElementAt(int index)
removeElementAt
in interface javax.swing.MutableComboBoxModel
public void replaceAll(java.util.List list)
list
- New listpublic void setSelectedIndex(int index)
index
- Indexpublic void setSelectedItem(java.lang.Object item)
setSelectedItem
in interface javax.swing.ComboBoxModel
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |