Class JaxxDefaultComboBoxModel<E>
- java.lang.Object
-
- javax.swing.AbstractListModel
-
- org.nuiton.jaxx.runtime.swing.model.JaxxDefaultComboBoxModel<E>
-
- All Implemented Interfaces:
Serializable,ComboBoxModel,ListModel,MutableComboBoxModel,ComboBoxModel2
- Direct Known Subclasses:
JaxxFilterableComboBoxModel
public class JaxxDefaultComboBoxModel<E> extends AbstractListModel implements MutableComboBoxModel, Serializable, ComboBoxModel2
To replace theDefaultComboBoxModelwhich usedVector. Add some new methods toaddAllElements(Collection)orsetAllElements(Collection).- Since:
- 2.5.10
- Author:
- Tony Chemit - dev@tchemit.fr
- See Also:
- Serialized Form
-
-
Field Summary
Fields Modifier and Type Field Description protected List<E>delegateprotected EselectedObject-
Fields inherited from class javax.swing.AbstractListModel
listenerList
-
-
Constructor Summary
Constructors Constructor Description JaxxDefaultComboBoxModel()JaxxDefaultComboBoxModel(E... items)JaxxDefaultComboBoxModel(Collection<E> v)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidaddAllElements(Collection<E> objects)voidaddElement(Object anObject)voidaddWillChangeSelectedItemListener(WillChangeSelectedItemListener l)Adds a listener to the list that's notified each time the selected item should be changed.voidfireSelectedItemWillChanged(Object currentSelectedItem, Object newSelectedItem)Notifies all listeners that have registered interest for notification on this event type.EgetElementAt(int index)intgetIndexOf(E anObject)EgetSelectedItem()intgetSize()voidinsertElementAt(Object anObject, int index)voidremoveAllElements()Empties the list.voidremoveElement(Object anObject)voidremoveElementAt(int index)voidremoveWillChangeSelectedItemListener(WillChangeSelectedItemListener l)Adds a listener to the list that's notified each time the selected item should be changed.voidsetAllElements(Collection<E> objects)voidsetSelectedItem(Object anObject)-
Methods inherited from class javax.swing.AbstractListModel
addListDataListener, fireContentsChanged, fireIntervalAdded, fireIntervalRemoved, getListDataListeners, getListeners, removeListDataListener
-
Methods inherited from interface javax.swing.ListModel
addListDataListener, removeListDataListener
-
-
-
-
Constructor Detail
-
JaxxDefaultComboBoxModel
public JaxxDefaultComboBoxModel()
-
JaxxDefaultComboBoxModel
public JaxxDefaultComboBoxModel(E... items)
-
JaxxDefaultComboBoxModel
public JaxxDefaultComboBoxModel(Collection<E> v)
-
-
Method Detail
-
setSelectedItem
public void setSelectedItem(Object anObject)
- Specified by:
setSelectedItemin interfaceComboBoxModel<E>
-
getIndexOf
public int getIndexOf(E anObject)
-
setAllElements
public void setAllElements(Collection<E> objects)
-
addAllElements
public void addAllElements(Collection<E> objects)
-
removeAllElements
public void removeAllElements()
Empties the list.
-
getSelectedItem
public E getSelectedItem()
- Specified by:
getSelectedItemin interfaceComboBoxModel<E>
-
getElementAt
public E getElementAt(int index)
- Specified by:
getElementAtin interfaceListModel<E>
-
addElement
public void addElement(Object anObject)
- Specified by:
addElementin interfaceMutableComboBoxModel<E>
-
insertElementAt
public void insertElementAt(Object anObject, int index)
- Specified by:
insertElementAtin interfaceMutableComboBoxModel<E>
-
removeElementAt
public void removeElementAt(int index)
- Specified by:
removeElementAtin interfaceMutableComboBoxModel<E>
-
removeElement
public void removeElement(Object anObject)
- Specified by:
removeElementin interfaceMutableComboBoxModel<E>
-
addWillChangeSelectedItemListener
public void addWillChangeSelectedItemListener(WillChangeSelectedItemListener l)
Description copied from interface:ComboBoxModel2Adds a listener to the list that's notified each time the selected item should be changed.- Specified by:
addWillChangeSelectedItemListenerin interfaceComboBoxModel2- Parameters:
l- theListDataListenerto be added
-
removeWillChangeSelectedItemListener
public void removeWillChangeSelectedItemListener(WillChangeSelectedItemListener l)
Description copied from interface:ComboBoxModel2Adds a listener to the list that's notified each time the selected item should be changed.- Specified by:
removeWillChangeSelectedItemListenerin interfaceComboBoxModel2- Parameters:
l- theListDataListenerto be removed
-
fireSelectedItemWillChanged
public void fireSelectedItemWillChanged(Object currentSelectedItem, Object newSelectedItem)
Notifies all listeners that have registered interest for notification on this event type. The event instance is lazily created using thecurrentSelectedItemandnewSelectedItemparameter.
-
-