E
- The type of the items in the model.public class GenericListModel<E>
extends javax.swing.AbstractListModel
implements javax.swing.ComboBoxModel, java.lang.Iterable<E>
Constructor and Description |
---|
GenericListModel(java.util.Collection<? extends E> consumers)
Constructs a list of consumers.
|
GenericListModel(java.util.List<? extends E> consumerList)
Constructs a list of consumers.
|
Modifier and Type | Method and Description |
---|---|
E |
getElementAt(int index)
Returns a specific consumer.
|
E |
getSelectedItem()
Returns the selected item.
|
int |
getSize()
Returns the number of consumers in the list.
|
java.util.Iterator<E> |
iterator()
The Iterator for the items in the model.
|
void |
setSelectedItem(java.lang.Object arg0)
Sets the selected item(s).
|
addListDataListener, fireContentsChanged, fireIntervalAdded, fireIntervalRemoved, getListDataListeners, getListeners, removeListDataListener
public GenericListModel(java.util.List<? extends E> consumerList)
consumerList
- List of consumerspublic GenericListModel(java.util.Collection<? extends E> consumers)
consumers
- The list of consumers.public E getElementAt(int index)
getElementAt
in interface javax.swing.ListModel
index
- of consumer.public int getSize()
getSize
in interface javax.swing.ListModel
public E getSelectedItem()
getSelectedItem
in interface javax.swing.ComboBoxModel
public void setSelectedItem(java.lang.Object arg0)
setSelectedItem
in interface javax.swing.ComboBoxModel
arg0
- items to be set as selected.
//TODO: Check this stuff...