|
||||||||||
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<K>
org.jdesktop.swingx.combobox.MapComboBoxModel<K,V>
K
- the type of keys maintained by the map backing this modelV
- the type of mapped valuespublic class MapComboBoxModel<K,V>
A ComboBoxModel
for Map
s. The model will always present a Map
consistently, once it is instantiated. However, unless the Map
is ordered, as a
java.util.TreeMap
is, the model is not guaranteed to present the maps in a consistent
order between instantiations.
Field Summary | |
---|---|
protected Map<K,V> |
map_data
The map backing this model. |
Fields inherited from class org.jdesktop.swingx.combobox.ListComboBoxModel |
---|
data, selected, UPDATE |
Fields inherited from class javax.swing.AbstractListModel |
---|
listenerList |
Constructor Summary | |
---|---|
MapComboBoxModel()
Creates an empty model. |
|
MapComboBoxModel(Map<K,V> map)
Creates a model backed by the specified map. |
Method Summary | |
---|---|
void |
actionPerformed(ActionEvent evt)
Invoked when an action occurs. |
int |
getSize()
Returns the length of the list. |
V |
getValue(int selectedItem)
Selects an item from the model and returns that map value. |
V |
getValue(Object selectedItem)
Selects an item from the model and returns that map value. |
Methods inherited from class org.jdesktop.swingx.combobox.ListComboBoxModel |
---|
getElementAt, getSelectedItem, setSelectedItem |
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 |
---|
protected Map<K,V> map_data
Constructor Detail |
---|
public MapComboBoxModel()
public MapComboBoxModel(Map<K,V> map)
map
- the map backing this modelMethod Detail |
---|
public int getSize()
getSize
in interface ListModel
getSize
in class ListComboBoxModel<K>
public void actionPerformed(ActionEvent evt)
actionPerformed
in interface ActionListener
actionPerformed
in class ListComboBoxModel<K>
public V getValue(Object selectedItem)
selectedItem
- the item to select
public V getValue(int selectedItem)
selectedItem
- selects the item at the specified index in this model
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |