|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectjavax.swing.AbstractListModel
gov.virginia.dcjs.gui.field.ComboBoxFieldModel
This mutable data model accepts a Relation and allows a key
* field to be specified by the user. This key field is stored in
* the database and may optionally be hidden from the user's view.
* Other fields in the Relation are displayed.
| Field Summary |
| Fields inherited from class javax.swing.AbstractListModel |
listenerList |
| Constructor Summary | |
ComboBoxFieldModel()
|
|
ComboBoxFieldModel(Relation r)
Populate the list with all fields from the given Relation
* . |
|
ComboBoxFieldModel(Relation r,
int key,
boolean showKey)
Populate the list with all fields from the given Relation
* . |
|
| Method Summary | |
void |
addElement(java.lang.Object record)
Add the specified Record element to the end of the
* list. |
java.lang.Object |
getElementAt(int index)
Obtain the entire data row as a delimited string * @param index Row to obtain the data for |
protected java.lang.String |
getListItem(long row)
|
java.lang.Object |
getSelectedItem()
Obtain the list value for the currently selected list item |
java.lang.String |
getSelectedKey()
Obtain the key value for the currently selected list item |
int |
getSize()
Obtain the number of items being managed in this list |
void |
insertElementAt(java.lang.Object record,
int index)
Add the specified Record element at the specified list index. |
void |
removeElement(java.lang.Object key)
Remove the specified String element from the list. |
void |
removeElementAt(int index)
Remove the specified String element from the list. |
void |
setSelectedItem(java.lang.Object item)
Move the selection to the item with the specified list value. |
void |
setSelectedKey(java.lang.String key)
Move the selection to the item with the specified key value. |
| 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 ComboBoxFieldModel()
public ComboBoxFieldModel(Relation r)
Relation
* . The first field will serve as the key and will be
* hidden from the user.
* @param r Data contents for list items
public ComboBoxFieldModel(Relation r,
int key,
boolean showKey)
Relation
* . The specified field index will serve as the key.
* If the showKey parameter is false, the key will also
* be hidden from the user.
* @param r Data contents for list items
* @param key Field index of database key for each list item
* @param showKey True when the key field value is to be visible to
* the user, false to hide the key field.
| Method Detail |
public java.lang.Object getSelectedItem()
getSelectedItem in interface javax.swing.ComboBoxModelpublic void setSelectedItem(java.lang.Object item)
String having the list
* value to move to.
setSelectedItem in interface javax.swing.ComboBoxModelpublic void addElement(java.lang.Object record)
Record element to the end of the
* list.
* @param record Two column (minimum) record containing the key value in the
* previously specified key column and the list description in the others.
addElement in interface javax.swing.MutableComboBoxModel
public void insertElementAt(java.lang.Object record,
int index)
Record element at the specified list index.
* Presently, this functionality is not implemented, but the element is simply
* added to the end of the list.
* @param record Two column record containing the key value in the
* first column and the list description in the second.
* @param index List location for the specified element.
insertElementAt in interface javax.swing.MutableComboBoxModelpublic void removeElement(java.lang.Object key)
String element from the list.
* An invalid key value has no impact upon the list.
* @param key Unique identifier to locate the element by.
removeElement in interface javax.swing.MutableComboBoxModelpublic void removeElementAt(int index)
String element from the list.
* An invalid index has no impact upon the list.
* @param index Zero based location of list element.
removeElementAt in interface javax.swing.MutableComboBoxModelpublic java.lang.String getSelectedKey()
public void setSelectedKey(java.lang.String key)
public java.lang.Object getElementAt(int index)
getElementAt in interface javax.swing.ListModelprotected java.lang.String getListItem(long row)
public int getSize()
getSize in interface javax.swing.ListModel
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||