Package com.aoindustries.swing
Class SynchronizingComboBoxModel<E>
- java.lang.Object
-
- javax.swing.AbstractListModel<E>
-
- javax.swing.DefaultComboBoxModel<E>
-
- com.aoindustries.swing.SynchronizingComboBoxModel<E>
-
- All Implemented Interfaces:
Serializable,ComboBoxModel<E>,ListModel<E>,MutableComboBoxModel<E>
public class SynchronizingComboBoxModel<E> extends DefaultComboBoxModel<E>
When requested, it will synchronize its list of elements to an externally- provided list. The is useful when the data source is obtained elsewhere and the list-based component needs to be synchronized. Since these updates may occur while a user is manipulating the components, only the minimum number of changes to the elements is made. Thus selections and other aspects of the component remain intact. Most importantly, if nothing in the list has changed, the component is not changed.- Author:
- AO Industries, Inc.
- See Also:
- Serialized Form
-
-
Field Summary
-
Fields inherited from class javax.swing.AbstractListModel
listenerList
-
-
Constructor Summary
Constructors Constructor Description SynchronizingComboBoxModel()SynchronizingComboBoxModel(E constantFirstRow)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidsynchronize(List<? extends E> list)Synchronizes the list, adding and removing only a minimum number of elements.-
Methods inherited from class javax.swing.DefaultComboBoxModel
addElement, getElementAt, getIndexOf, getSelectedItem, getSize, insertElementAt, removeAllElements, removeElement, removeElementAt, 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
-
-
-
-
Constructor Detail
-
SynchronizingComboBoxModel
public SynchronizingComboBoxModel()
-
SynchronizingComboBoxModel
public SynchronizingComboBoxModel(E constantFirstRow)
-
-