Class BeanListComboBoxModel<T>
- java.lang.Object
-
- javax.swing.AbstractListModel<T>
-
- io.github.jonestimd.swing.list.BeanListModel<T>
-
- io.github.jonestimd.swing.component.BeanListComboBoxModel<T>
-
- Type Parameters:
T
- the class of the beans in the model
- All Implemented Interfaces:
LazyLoadComboBoxModel<T>
,LazyLoadListModel<T>
,java.io.Serializable
,java.lang.Iterable<T>
,javax.swing.ComboBoxModel<T>
,javax.swing.ListModel<T>
,javax.swing.MutableComboBoxModel<T>
- Direct Known Subclasses:
FileSuggestModel
public class BeanListComboBoxModel<T> extends BeanListModel<T> implements LazyLoadComboBoxModel<T>, javax.swing.MutableComboBoxModel<T>
AMutableComboBoxModel
that supports lazy loading.- See Also:
- Serialized Form
-
-
Constructor Summary
Constructors Constructor Description BeanListComboBoxModel()
BeanListComboBoxModel(java.util.Collection<? extends T> elements)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description T
getSelectedItem()
void
removeAll()
Clear the list of items.void
setElements(java.util.Collection<? extends T> elements, boolean keepSelection)
Replace the elements.void
setSelectedItem(java.lang.Object anItem)
-
Methods inherited from class io.github.jonestimd.swing.list.BeanListModel
addAllElements, addElement, addMissingElements, contains, getElementAt, getSize, indexOf, insertElementAt, iterator, removeElement, removeElementAt, setElements
-
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 io.github.jonestimd.swing.component.LazyLoadComboBoxModel
addElement, addMissingElements, indexOf
-
-
-
-
Constructor Detail
-
BeanListComboBoxModel
public BeanListComboBoxModel()
-
BeanListComboBoxModel
public BeanListComboBoxModel(java.util.Collection<? extends T> elements)
-
-
Method Detail
-
setElements
public void setElements(java.util.Collection<? extends T> elements, boolean keepSelection)
Replace the elements.- Specified by:
setElements
in interfaceLazyLoadComboBoxModel<T>
- Parameters:
elements
- the new elementskeepSelection
- if true then the selected item is not changed, if false then the selected item is cleared if it is not inelements
-
removeAll
public void removeAll()
Description copied from class:BeanListModel
Clear the list of items.- Overrides:
removeAll
in classBeanListModel<T>
-
getSelectedItem
public T getSelectedItem()
- Specified by:
getSelectedItem
in interfacejavax.swing.ComboBoxModel<T>
-
setSelectedItem
public void setSelectedItem(java.lang.Object anItem)
- Specified by:
setSelectedItem
in interfacejavax.swing.ComboBoxModel<T>
-
-