|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--javax.swing.AbstractListModel | +--iglu.jdbc.JDBCComboBoxModel
implements a comboboxmodel so that the user can drop result sets into list or combo boxes. Assume that the last column is an integer which uniquely identifies a row in the table. Will also work as a ListModel.
Nested Class Summary | |
static class |
JDBCComboBoxModel.ListItem
This is how the items are stored in the list internally. |
Field Summary | |
protected int[] |
displayCols
Which columns to display. |
protected java.sql.ResultSet |
rs
The result set which provides the information for this model. |
protected JDBCComboBoxModel.ListItem |
selectedItem
Which item is currently selected. |
protected int |
size
The number of items in the result set. |
Fields inherited from class javax.swing.AbstractListModel |
listenerList |
Constructor Summary | |
JDBCComboBoxModel()
Don't do anything |
|
JDBCComboBoxModel(java.sql.ResultSet nrs,
int[] ndisplayCols)
Create a comboBox Model from the given data. |
Method Summary | |
protected void |
figureSize()
figure out how many items there are. |
java.lang.Object |
getElementAt(int index)
Get the element at index. |
java.lang.Object |
getSelectedItem()
Return the selected item |
java.lang.String |
getSelectedString(int colnum)
Get the string of the currently selected item. |
int |
getSize()
Get the number of items |
void |
setSelectedItem(java.lang.Object anItem)
set the selected item. |
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 |
Field Detail |
protected java.sql.ResultSet rs
protected int[] displayCols
protected int size
protected JDBCComboBoxModel.ListItem selectedItem
Constructor Detail |
public JDBCComboBoxModel()
public JDBCComboBoxModel(java.sql.ResultSet nrs, int[] ndisplayCols)
nrs
- The result set to use.ndisplayCols
- The columns to display. See displayCols for more
information.Method Detail |
public java.lang.Object getElementAt(int index)
getElementAt
in interface javax.swing.ListModel
index
- public int getSize()
getSize
in interface javax.swing.ListModel
public void setSelectedItem(java.lang.Object anItem)
setSelectedItem
in interface javax.swing.ComboBoxModel
anItem
- public java.lang.Object getSelectedItem()
getSelectedItem
in interface javax.swing.ComboBoxModel
public java.lang.String getSelectedString(int colnum)
colnum
- protected void figureSize()
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |