|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--magi.toolkit.fields.MagiComboBoxModel
A Combo Box Model that allows easy data setting and retrieval.
MagiComboBox
,
ComboList
Constructor Summary | |
MagiComboBoxModel()
Default constructor. |
|
MagiComboBoxModel(java.util.Collection collection)
Create a model with any Collection of Objects, for example a List, Set, Vector, etc. |
|
MagiComboBoxModel(java.util.Collection collection,
int index)
Create a model with any Collection of Objects, for example a List, Set, Vector, etc. |
|
MagiComboBoxModel(java.lang.Object[] objectArray)
Create a model with the specified array of Objects. |
|
MagiComboBoxModel(java.lang.Object[] objectArray,
int index)
Create a model with the specified array of Objects. |
Method Summary | |
void |
addItem(java.lang.Object item)
Adds an item Object to the end of the combo data. |
void |
addListDataListener(javax.swing.event.ListDataListener l)
Add a list data listener, to be notified whenever the model's data changes. |
ComboList |
getData()
Retrieve the list of data stored in this model. |
java.lang.Object |
getElementAt(int index)
Returns the item in the data set identified by index. |
int |
getSelectedIndex()
Returns the selected index for this combo box. |
java.lang.Object |
getSelectedItem()
Returns the selected item for this combo box. |
int |
getSize()
Returns the size of data stored in this model. |
void |
removeItem(java.lang.Object item)
Removes an item Object from the combo data. |
void |
removeListDataListener(javax.swing.event.ListDataListener l)
Remove a list data listener from this model. |
void |
setData(ComboList comboList)
Sets the list of data stored in this model. |
void |
setSelectedIndex(int index)
Sets the selected index for this combo box. |
void |
setSelectedItem(java.lang.Object item)
Sets the selected item for this combo box. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
public MagiComboBoxModel()
public MagiComboBoxModel(java.lang.Object[] objectArray)
objectArray
- an array of Objects to populate with.public MagiComboBoxModel(java.util.Collection collection)
collection
- any Collection of Objects.public MagiComboBoxModel(java.lang.Object[] objectArray, int index)
objectArray
- an array of Objects to populate with.index
- the index of the selected item.public MagiComboBoxModel(java.util.Collection collection, int index)
collection
- any Collection of Objects.index
- the index of the selected item.Method Detail |
public void setSelectedItem(java.lang.Object item)
setSelectedItem
in interface javax.swing.ComboBoxModel
item
- the item Object to select.public java.lang.Object getSelectedItem()
getSelectedItem
in interface javax.swing.ComboBoxModel
public void setSelectedIndex(int index)
index
- the int index to select.public int getSelectedIndex()
public int getSize()
getSize
in interface javax.swing.ListModel
public java.lang.Object getElementAt(int index)
getElementAt
in interface javax.swing.ListModel
index
- the index of the item to retrieve.
public void addListDataListener(javax.swing.event.ListDataListener l)
addListDataListener
in interface javax.swing.ListModel
l
- the ListDataListener to attach.public void removeListDataListener(javax.swing.event.ListDataListener l)
removeListDataListener
in interface javax.swing.ListModel
l
- the ListDataListener to remove.public ComboList getData()
public void setData(ComboList comboList)
comboList
- a ComboList of data elements.public void addItem(java.lang.Object item)
item
- an item Object to add to the end.removeItem(Object)
public void removeItem(java.lang.Object item)
item
- an item Object to remove.addItem(Object)
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |