java.lang.Iterable, java.util.Collection, java.util.List, javax.swing.ListModelpublic class OptionsListModel
extends java.util.AbstractList
implements javax.swing.ListModel
List and
ListModel (which ListModel really
ought to do itself), and also provides methods to create
some useful models like JComboBoxModel based on the same data.| Constructor | Description |
|---|---|
OptionsListModel() |
| Modifier and Type | Method | Description |
|---|---|---|
boolean |
add(java.lang.Object obj) |
|
void |
addListDataListener(javax.swing.event.ListDataListener l) |
|
void |
fireContentsChanged(int i0,
int i1) |
|
void |
fireIntervalAdded(int i0,
int i1) |
|
void |
fireIntervalRemoved(int i0,
int i1) |
|
java.lang.Object |
get(int index) |
|
java.lang.Object |
getElementAt(int index) |
|
int |
getSize() |
|
int |
idToIndex(int id) |
Returns the index at which an option with the given ID currently resides.
|
int |
indexToId(int index) |
Returns the unique ID value for the option currently at a given index
in this list.
|
CheckBoxMenu |
makeCheckBoxMenu(java.lang.String menuName) |
|
javax.swing.JComboBox |
makeComboBox() |
Makes a new JComboBox from this model.
|
javax.swing.ComboBoxModel |
makeComboBoxModel() |
Constructs a new ComboBoxModel backed by this list.
|
javax.swing.JMenu |
makeJMenu(java.lang.String menuName,
javax.swing.Action menuAction) |
Constructs a new JMenu backed by this list.
|
java.lang.Object |
remove(int irow) |
|
void |
removeListDataListener(javax.swing.event.ListDataListener l) |
|
java.lang.Object |
set(int irow,
java.lang.Object obj) |
|
int |
size() |
addAll, contains, containsAll, isEmpty, remove, removeAll, retainAll, toArray, toArray, toStringadd, addAll, clear, equals, hashCode, indexOf, iterator, lastIndexOf, listIterator, listIterator, removeRange, subListpublic java.lang.Object get(int index)
get in interface java.util.Listget in class java.util.AbstractListpublic java.lang.Object getElementAt(int index)
getElementAt in interface javax.swing.ListModelpublic int size()
size in interface java.util.Collectionsize in interface java.util.Listsize in class java.util.AbstractCollectionpublic int getSize()
getSize in interface javax.swing.ListModelpublic boolean add(java.lang.Object obj)
add in interface java.util.Collectionadd in interface java.util.Listadd in class java.util.AbstractListpublic java.lang.Object set(int irow,
java.lang.Object obj)
set in interface java.util.Listset in class java.util.AbstractListpublic java.lang.Object remove(int irow)
remove in interface java.util.Listremove in class java.util.AbstractListpublic int indexToId(int index)
index - current index for optionpublic int idToIndex(int id)
id - unique identifierid, or -1indexToId(int)public javax.swing.ComboBoxModel makeComboBoxModel()
makeComboBox()public javax.swing.JComboBox makeComboBox()
makeComboBoxModel() by ensuring that the box is
revalidated when new items are added to the model; otherwise the
box can end up too small. It also ensures that the box is
rendered by using the name of the RowSubset is written.public javax.swing.JMenu makeJMenu(java.lang.String menuName,
javax.swing.Action menuAction)
menuName - the name of the menumenuAction - the action to activatepublic CheckBoxMenu makeCheckBoxMenu(java.lang.String menuName)
public void addListDataListener(javax.swing.event.ListDataListener l)
addListDataListener in interface javax.swing.ListModelpublic void removeListDataListener(javax.swing.event.ListDataListener l)
removeListDataListener in interface javax.swing.ListModelpublic void fireContentsChanged(int i0,
int i1)
public void fireIntervalAdded(int i0,
int i1)
public void fireIntervalRemoved(int i0,
int i1)
Copyright © 2003-2018 CCLRC: Council for the Central Laboratory of the Research Councils. All Rights Reserved.