|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object javax.swing.AbstractListModel org.xulux.guilayer.swing.models.DefaultComboModel
public class DefaultComboModel
The default combobox model.
Nested Class Summary | |
---|---|
class |
DefaultComboModel.ComboShowable
Holds all items in a list |
Field Summary |
---|
Fields inherited from class javax.swing.AbstractListModel |
---|
listenerList |
Constructor Summary | |
---|---|
DefaultComboModel()
don't do anything, since we don't have any data.. |
|
DefaultComboModel(java.util.List list,
java.lang.String field,
Combo combo)
Constructor for DefaultComboModel. |
Method Summary | |
---|---|
void |
destroy()
Clean up combomodel (if at all needed) |
java.lang.Object |
getElementAt(int index)
The comboshowable which is requested by the JCombo object. |
protected java.util.List |
getList()
|
protected java.util.List |
getOriginal()
|
java.lang.Object |
getRealSelectedValue()
|
int |
getSelectedIndex()
|
java.lang.Object |
getSelectedItem()
|
int |
getSize()
|
protected void |
initialize()
Initialize the model and the data |
void |
setRealSelectedValue(java.lang.Object selectedItem)
Set the real selected item (so not the comboshowable. |
void |
setSelectedItem(int index)
Set the selected item to the specified index |
void |
setSelectedItem(java.lang.Object anItem)
When using the arrow keys to select another item from the combo, we have to fire an event with the index0 and the index1 with the value -1. |
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 DefaultComboModel()
public DefaultComboModel(java.util.List list, java.lang.String field, Combo combo)
list
- the list with datafield
- the field to usecombo
- the combo usedMethod Detail |
---|
public void setSelectedItem(java.lang.Object anItem)
setSelectedItem
in interface javax.swing.ComboBoxModel
ComboBoxModel.setSelectedItem(Object)
public void setSelectedItem(int index)
index
- the index to selectpublic java.lang.Object getSelectedItem()
getSelectedItem
in interface javax.swing.ComboBoxModel
ComboBoxModel.getSelectedItem()
public int getSize()
getSize
in interface javax.swing.ListModel
ListModel.getSize()
public java.lang.Object getElementAt(int index)
getElementAt
in interface javax.swing.ListModel
ListModel.getElementAt(int)
public java.lang.Object getRealSelectedValue()
public int getSelectedIndex()
public void setRealSelectedValue(java.lang.Object selectedItem)
selectedItem
- the real selected itemprotected void initialize()
public void destroy()
protected java.util.List getOriginal()
protected java.util.List getList()
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |