org.jfree.report.modules.gui.swing.common
public class KeyedComboBoxModel extends Object implements ComboBoxModel
Constructor Summary | |
---|---|
KeyedComboBoxModel()
Creates a new keyed combobox model. | |
KeyedComboBoxModel(Object[] keys, Object[] values)
Creates a new keyed combobox model for the given keys and values. |
Method Summary | |
---|---|
void | add(Object key, Object cbitem)
Adds a new entry to the model.
|
void | addListDataListener(ListDataListener l)
Adds a listener to the list that's notified each time a change to the data
model occurs.
|
void | clear()
Removes all entries from the model. |
int | findElementIndex(Object key)
Tries to find the index of element with the given key. |
protected void | fireListDataEvent(ListDataEvent evt)
Notifies all registered list data listener of the given event.
|
Object | getElementAt(int index)
Returns the value at the specified index.
|
Object | getKeyAt(int index)
Returns the key from the given index.
|
Object | getSelectedItem()
Returns the selected item.
|
Object | getSelectedKey()
Returns the selected data element or null if none is set.
|
int | getSize()
Returns the length of the list.
|
void | removeDataElement(Object key)
Removes an entry from the model.
|
void | removeListDataListener(ListDataListener l)
Removes a listener from the list that's notified each time a change to
the data model occurs.
|
void | setAllowOtherValue(boolean allowOtherValue) |
void | setData(Object[] keys, Object[] values)
Replaces the data in this combobox model. |
void | setSelectedItem(Object anItem)
Set the selected item. |
void | setSelectedKey(Object anItem)
Defines the selected key. |
Parameters: keys the keys values the values
Parameters: key the key cbitem the display value.
Parameters: l the ListDataListener
to be added
Parameters: key the key for the element to be searched.
Returns: the index of the key, or -1 if not found.
Parameters: evt the event.
Parameters: index the requested index
Returns: the value at index
Parameters: index the index of the key.
Returns: the the key at the specified index.
Returns: The selected item or null
if there is no selection
Returns: the selected data element.
Returns: the length of the list
Parameters: key the key
Parameters: l the ListDataListener
to be removed
Parameters: keys the keys values the values
ListDataListener
s that the contents have
changed.
Parameters: anItem the list object to select or null
to clear the
selection
Parameters: anItem the new selected item.