Documentation of 'org.jdesktop.swingx.combobox.ListComboBoxModel' Java class
ListComboBoxModel
org.jdesktop.swingx.combobox

Class ListComboBoxModel<E>

  • Type Parameters:
    E - the type of elements maintained by the list backing this model
    All Implemented Interfaces:
    java.awt.event.ActionListener, java.io.Serializable, java.util.EventListener, javax.swing.ComboBoxModel, javax.swing.ListModel
    Direct Known Subclasses:
    EnumComboBoxModel, MapComboBoxModel


    public class ListComboBoxModel<E>
    extends javax.swing.AbstractListModel
    implements javax.swing.ComboBoxModel, java.awt.event.ActionListener
    A ComboBoxModel for Lists.
    See Also:
    Serialized Form
    • Field Summary

      Fields 
      Modifier and Type Field and Description
      static java.lang.String UPDATE
      A key used to notify the model that the backing List has changed.
    • Constructor Summary

      Constructors 
      Constructor and Description
      ListComboBoxModel(java.util.List<E> list)
      Creates a ListComboBoxModel backed by the supplied list.
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method and Description
      void actionPerformed(java.awt.event.ActionEvent evt)
      E getElementAt(int index)
      E getSelectedItem()
      int getSize()
      void setSelectedItem(java.lang.Object item)
      Set the selected item.
      • Methods inherited from class javax.swing.AbstractListModel

        addListDataListener, getListDataListeners, getListeners, removeListDataListener
      • Methods inherited from class java.lang.Object

        equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
      • Methods inherited from interface javax.swing.ListModel

        addListDataListener, removeListDataListener
    • Field Detail

      • UPDATE

        public static final java.lang.String UPDATE
        A key used to notify the model that the backing List has changed.
        See Also:
        Constant Field Values
    • Constructor Detail

      • ListComboBoxModel

        public ListComboBoxModel(java.util.List<E> list)
        Creates a ListComboBoxModel backed by the supplied list.
        Parameters:
        list - the list backing this model
        Throws:
        java.lang.NullPointerException - if list is null
    • Method Detail

      • setSelectedItem

        public void setSelectedItem(java.lang.Object item)
        Set the selected item. The implementation of this method should notify all registered ListDataListeners that the contents have changed.
        Specified by:
        setSelectedItem in interface javax.swing.ComboBoxModel
        Parameters:
        item - the list object to select or null to clear the selection
        Throws:
        java.lang.ClassCastException - if item is not of type E
      • getSelectedItem

        public E getSelectedItem()
        Specified by:
        getSelectedItem in interface javax.swing.ComboBoxModel
      • getElementAt

        public E getElementAt(int index)
        Specified by:
        getElementAt in interface javax.swing.ListModel
      • getSize

        public int getSize()
        Specified by:
        getSize in interface javax.swing.ListModel
      • actionPerformed

        public void actionPerformed(java.awt.event.ActionEvent evt)
        Specified by:
        actionPerformed in interface java.awt.event.ActionListener

DataMelt 3.0 © DataMelt by jWork.ORG

Ads help maintain this website.