|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectca.odell.glazedlists.swing.DefaultEventListModel<E>
ca.odell.glazedlists.swing.DefaultEventComboBoxModel<E>
public class DefaultEventComboBoxModel<E>
A combo box model for displaying Glazed Lists in a combo box.
The DefaultEventComboBoxModel class is not thread-safe. Unless
otherwise noted, all methods are only safe to be called from the event
dispatch thread. To do this programmatically, use SwingUtilities.invokeAndWait(Runnable)
and wrap the source list (or some part of the source list's pipeline) using
GlazedListsSwing.swingThreadProxyList(EventList)
.
The implementation of setSelectedItem(java.lang.Object)
and getSelectedItem()
is not in any way tied to the contents of the list.
Field Summary |
---|
Fields inherited from class ca.odell.glazedlists.swing.DefaultEventListModel |
---|
listDataEvent, source |
Constructor Summary | |
---|---|
|
DefaultEventComboBoxModel(EventList<E> source)
Creates a new combo box model that contains the elements of the given source and tracks further changes made to it. |
protected |
DefaultEventComboBoxModel(EventList<E> source,
boolean disposeSource)
Creates a new combo box model that contains the elements of the given source and tracks further changes made to it. |
Method Summary | |
---|---|
Object |
getSelectedItem()
Gets the currently selected item. |
void |
setSelectedItem(Object selected)
Sets the currently selected item. |
Methods inherited from class ca.odell.glazedlists.swing.DefaultEventListModel |
---|
addListDataListener, dispose, fireListDataEvent, getElementAt, getSize, listChanged, 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, getElementAt, getSize, removeListDataListener |
Constructor Detail |
---|
public DefaultEventComboBoxModel(EventList<E> source)
source
and tracks further changes made to it.
source
- the EventList that provides the elementsprotected DefaultEventComboBoxModel(EventList<E> source, boolean disposeSource)
source
and tracks further changes made to it.
source
- the EventList that provides the elementsdiposeSource
- true
if the source list should be disposed when disposing
this model, false
otherwiseMethod Detail |
---|
public Object getSelectedItem()
getSelectedItem
in interface ComboBoxModel
public void setSelectedItem(Object selected)
The selection notification process is very much a hack. This fires
a ListDataEvent where the range is between -1 and -1. This is identical
to the notification process used by the DefaultComboBoxModel
.
setSelectedItem
in interface ComboBoxModel
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |