ItemType - the type of item that this model contains.public class SingleSelectionModel<ItemType>
extends javax.swing.DefaultComboBoxModel<ItemType>
To listen for selection changes, attach and use the callback in
ListDataListener.contentsChanged(javax.swing.event.ListDataEvent).
| Constructor and Description |
|---|
SingleSelectionModel(java.util.List<ItemType> allItems) |
| Modifier and Type | Method and Description |
|---|---|
java.util.List<ItemType> |
getAllItems() |
ItemType |
getSelection()
Type-checked version of
DefaultComboBoxModel.getSelectedItem() |
void |
increment()
Select the next element in the list.
|
void |
setAllItems(java.util.List<ItemType> allItems)
use new set of possible items.
|
addElement, getElementAt, getIndexOf, getSelectedItem, getSize, insertElementAt, removeAllElements, removeElement, removeElementAt, setSelectedItemaddListDataListener, fireContentsChanged, fireIntervalAdded, fireIntervalRemoved, getListDataListeners, getListeners, removeListDataListenerpublic SingleSelectionModel(java.util.List<ItemType> allItems)
public void setAllItems(java.util.List<ItemType> allItems)
allItems - public java.util.List<ItemType> getAllItems()
public ItemType getSelection()
DefaultComboBoxModel.getSelectedItem()public void increment()