Class DefaultEventComboBoxModel<E>

    • Constructor Detail

      • DefaultEventComboBoxModel

        public 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.
        Parameters:
        source - the EventList that provides the elements
      • DefaultEventComboBoxModel

        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.
        Parameters:
        source - the EventList that provides the elements
        diposeSource - true if the source list should be disposed when disposing this model, false otherwise
    • Method Detail

      • getSelectedItem

        public java.lang.Object getSelectedItem()
        Gets the currently selected item.
        Specified by:
        getSelectedItem in interface javax.swing.ComboBoxModel<E>
      • setSelectedItem

        public void setSelectedItem​(java.lang.Object selected)
        Sets the currently selected item.

        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.

        Specified by:
        setSelectedItem in interface javax.swing.ComboBoxModel<E>