Class 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>
    A MutableComboBoxModel that supports lazy loading.
    See Also:
    Serialized Form
    • 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 interface LazyLoadComboBoxModel<T>
        Parameters:
        elements - the new elements
        keepSelection - if true then the selected item is not changed, if false then the selected item is cleared if it is not in elements
      • getSelectedItem

        public T getSelectedItem()
        Specified by:
        getSelectedItem in interface javax.swing.ComboBoxModel<T>
      • setSelectedItem

        public void setSelectedItem​(java.lang.Object anItem)
        Specified by:
        setSelectedItem in interface javax.swing.ComboBoxModel<T>