|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object javax.swing.table.AbstractTableModel org.bibalex.daf.handlers.dbhandler.DataTable org.bibalex.daf.commongui.datamodels.ComboBoxDataModel
public class ComboBoxDataModel
This class is an implementation of the ComboBoxModel, that also supports (extends) DataTable. Used as a DataModel for the ComboBoxes that are filled through DataTables.
Nested Class Summary | |
---|---|
class |
ComboBoxDataModel.ComboBoxObject
This Class represents a ComboBox item. |
Field Summary | |
---|---|
protected int |
colID
The Column in the DataTable that represents the ID of the row. |
protected int |
colVisible
The Column in the DataTable to be displayed in the ComboBox. |
protected int |
selectedItemIndex
The selected Item index in the ComboBox. |
Fields inherited from class javax.swing.table.AbstractTableModel |
---|
listenerList |
Constructor Summary | |
---|---|
ComboBoxDataModel(DataTable dataTable,
int colID,
int colVisible)
Constructor |
Method Summary | |
---|---|
void |
addListDataListener(javax.swing.event.ListDataListener l)
Adds a ListDataListener. |
java.lang.Object |
getElementAt(int index)
Retreives the ComboBoxObject at the given selected Index. |
int |
getIndexOf(int id)
Retrives the Index of a given ID from within the List. |
int |
getSelectedID()
Retreives the selected DB ID and not the selected Index. |
java.lang.Object |
getSelectedItem()
Retreives the selected Item as a ComboBoxObject. |
int |
getSize()
Returns the size of the combo box. |
void |
removeListDataListener(javax.swing.event.ListDataListener l)
Removes a ListDataListener. |
void |
setSelectedID(int id)
Sets the selected Item from the list based on the DB ID and not the list index. |
void |
setSelectedItem(java.lang.Object anItem)
Sets a specific item as the selected one in the ComboBox. |
Methods inherited from class org.bibalex.daf.handlers.dbhandler.DataTable |
---|
addRow, addRow, addRowAt, addRowAt, deleteRow, elementAt, elementAt, ExportToExcel, getColumnCount, getColumnName, getDynamicColumnIndices, getNameOfColumn, getNoOfColumns, getNoOfRows, getRow, getRowCount, getValueAt, setArchivingMatrix, setDynamicColumnIndices, setDynamicTable, setNameOfColumn, setNoOfColumn, setValueAt |
Methods inherited from class javax.swing.table.AbstractTableModel |
---|
addTableModelListener, findColumn, fireTableCellUpdated, fireTableChanged, fireTableDataChanged, fireTableRowsDeleted, fireTableRowsInserted, fireTableRowsUpdated, fireTableStructureChanged, getColumnClass, getListeners, getTableModelListeners, isCellEditable, removeTableModelListener |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
protected int colID
protected int colVisible
protected int selectedItemIndex
Constructor Detail |
---|
public ComboBoxDataModel(DataTable dataTable, int colID, int colVisible)
dataTable
- The DataTable to extract the values from.colID
- The Column in the DataTable that represents the ID of the row.colVisible
- The Column in the DataTable to be displayed in the ComboBox.Method Detail |
---|
public void setSelectedItem(java.lang.Object anItem)
setSelectedItem
in interface javax.swing.ComboBoxModel
anItem
- The object to set as selected.public java.lang.Object getSelectedItem()
getSelectedItem
in interface javax.swing.ComboBoxModel
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 to retrieve the element at.
public void addListDataListener(javax.swing.event.ListDataListener l)
addListDataListener
in interface javax.swing.ListModel
l
- The Implementation of the ListDataListener class to be added.public void removeListDataListener(javax.swing.event.ListDataListener l)
removeListDataListener
in interface javax.swing.ListModel
l
- The Implementation of the ListDataListener class to be added.public int getSelectedID()
public void setSelectedID(int id)
id
- The DB ID for which its item is selected.public int getIndexOf(int id)
id
- The DB ID to fetch on.
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |