|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectjavax.swing.AbstractListModel
javax.swing.DefaultComboBoxModel
uk.ac.starlink.util.gui.ChangingComboBoxModel
public class ChangingComboBoxModel
ComboBoxModel which can notify ChangeListener
s
and ActionListener
s of changes in the selection.
Field Summary |
---|
Fields inherited from class javax.swing.AbstractListModel |
---|
listenerList |
Constructor Summary | |
---|---|
ChangingComboBoxModel()
Constructs an empty model. |
|
ChangingComboBoxModel(Object[] items)
Constructs a model with a given initial list of items. |
Method Summary | |
---|---|
void |
addActionListener(ActionListener listener)
Adds a listener which is notified whenever the selection changes. |
void |
addChangeListener(ChangeListener listener)
Adds a listener which is notified whenever the selection changes. |
protected void |
fireActionPerformed(Object source)
Called to notify listeners of a change. |
protected void |
fireSelectionChanged(Object source)
Called to notify listeners of a change. |
void |
removeActionListener(ActionListener listener)
Removes a listener previously added by #addListener . |
void |
removeChangeListener(ChangeListener listener)
Removes a listener previously added by #addListener . |
void |
setSelectedItem(Object item)
|
Methods inherited from class javax.swing.DefaultComboBoxModel |
---|
addElement, getElementAt, getIndexOf, getSelectedItem, getSize, insertElementAt, removeAllElements, removeElement, removeElementAt |
Methods inherited from class javax.swing.AbstractListModel |
---|
addListDataListener, fireContentsChanged, fireIntervalAdded, fireIntervalRemoved, getListDataListeners, getListeners, removeListDataListener |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Methods inherited from interface javax.swing.ListModel |
---|
addListDataListener, removeListDataListener |
Constructor Detail |
---|
public ChangingComboBoxModel()
public ChangingComboBoxModel(Object[] items)
items
- initial list of items in the modelMethod Detail |
---|
public void addChangeListener(ChangeListener listener)
listener
- listener to addpublic void removeChangeListener(ChangeListener listener)
#addListener
.
listener
- listener to removepublic void addActionListener(ActionListener listener)
listener
- listener to addpublic void removeActionListener(ActionListener listener)
#addListener
.
listener
- listener to removepublic void setSelectedItem(Object item)
setSelectedItem
in interface ComboBoxModel
setSelectedItem
in class DefaultComboBoxModel
protected void fireSelectionChanged(Object source)
source
- change sourceprotected void fireActionPerformed(Object source)
source
- change source
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |