Package eu.bandm.tools.graficUtils
Class SwingTools.EnabledJComboBoxModel<D>
java.lang.Object
javax.swing.AbstractListModel
javax.swing.DefaultComboBoxModel
eu.bandm.tools.graficUtils.SwingTools.EnabledJComboBoxModel<D>
- All Implemented Interfaces:
Serializable,ComboBoxModel,ListModel,MutableComboBoxModel
- Enclosing class:
SwingTools
JComboBox data model which prohibits the selection of disabled items.
Thanks to https://stackoverflow.com/questions/11895822/disabling-individual-jcombobox-items and https://stackoverflow.com/questions/28344126/java-make-one-item-of-a-jcombobox-unselectablelike-for-a-sub-caption-and-edit/28344521#28344521
- See Also:
-
Field Summary
Fields inherited from class javax.swing.AbstractListModel
listenerList -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionsetPredicate(@Opt Predicate<D> predicate) voidsetSelectedItem(Object item) Methods inherited from class javax.swing.DefaultComboBoxModel
addAll, addAll, addElement, getElementAt, getIndexOf, getSelectedItem, getSize, insertElementAt, removeAllElements, removeElement, removeElementAtMethods inherited from class javax.swing.AbstractListModel
addListDataListener, fireContentsChanged, fireIntervalAdded, fireIntervalRemoved, getListDataListeners, getListeners, removeListDataListenerMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface javax.swing.ListModel
addListDataListener, removeListDataListener
-
Constructor Details
-
EnabledJComboBoxModel
public EnabledJComboBoxModel() -
EnabledJComboBoxModel
-
-
Method Details
-
setPredicate
-
setSelectedItem
- Specified by:
setSelectedItemin interfaceComboBoxModel<D>- Overrides:
setSelectedItemin classDefaultComboBoxModel
-