public class G9ComboBoxModel extends DefaultComboBoxModel implements Comparator<Object>
listenerList| Constructor and Description |
|---|
G9ComboBoxModel()
Constructs an empty G9ComboBoxModel object.
|
G9ComboBoxModel(Object[] items)
Constructs a G9ComboBoxModel object initialized with an array of
objects.
|
G9ComboBoxModel(Vector<?> v)
Constructs a G9ComboBoxModel object initialized with a vector.
|
| Modifier and Type | Method and Description |
|---|---|
void |
addElement(Object anObject) |
void |
addElements(Collection<? extends Object> items)
Adds a collection of elements to the combo box model.
|
int |
compare(Object o1,
Object o2)
Compares its two arguments for order.
|
boolean |
isSorted()
Returns the isSorted property
|
void |
removeAllElements() |
void |
removeElement(Object anObject) |
void |
removeElementAt(int index) |
void |
setSorted(boolean isSorted)
Sets the isSorted property.
|
getElementAt, getIndexOf, getSelectedItem, getSize, insertElementAt, setSelectedItemaddListDataListener, fireContentsChanged, fireIntervalAdded, fireIntervalRemoved, getListDataListeners, getListeners, removeListDataListenerclone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitcomparing, comparing, comparingDouble, comparingInt, comparingLong, equals, naturalOrder, nullsFirst, nullsLast, reversed, reverseOrder, thenComparing, thenComparing, thenComparing, thenComparingDouble, thenComparingInt, thenComparingLongaddListDataListener, removeListDataListenerpublic G9ComboBoxModel()
public G9ComboBoxModel(Object[] items)
items - an array of Object objectspublic G9ComboBoxModel(Vector<?> v)
v - a Vector objectpublic void addElement(Object anObject)
If this is a sorted combo box, and the added object is not null, and the added object is first in the sorted sequence, the added item is selected. If the specified object equals an object already present in the list, it is put just before the element in the list.
addElement in interface MutableComboBoxModeladdElement in class DefaultComboBoxModelpublic void addElements(Collection<? extends Object> items)
items - the collection of items to add.public boolean isSorted()
true if elements in this combo are sorted.public void setSorted(boolean isSorted)
true the elements in
this combo is sorted.isSorted - the isSorted propertyaddElement(Object)public int compare(Object o1, Object o2)
Note that null is considered the smalles possible
value. The comparison is done by
TypeTool.compareTo(Object, Object), ensuring a locale dependent
comparison of Strings. Enumerations are compared using the title.
compare in interface Comparator<Object>o1 - the first object to be comparedo2 - the second object to be comparedpublic void removeAllElements()
removeAllElements in class DefaultComboBoxModelpublic void removeElement(Object anObject)
removeElement in interface MutableComboBoxModelremoveElement in class DefaultComboBoxModelpublic void removeElementAt(int index)
removeElementAt in interface MutableComboBoxModelremoveElementAt in class DefaultComboBoxModelCopyright © 2006–2017 Esito AS. All rights reserved.