borland Packages Class Hierarchy dbswing Package
java.lang.Object +----javax.swing.table.AbstractTableModel +----com.borland.dbswing.DBTableModel
Variables Constructors Properties Methods Event Listeners
Implements AccessListener, DataChangeListener, DataSetAware, Designable, Serializable, EventListener, TableModel
DBTableModel
is an implementation of the Swing TableModel
. It obtains its model data from a DataExpress DataSet
. DBTableModel
is the default TableModel
for a JdbTable
that has a non-null DataSet
.
DBTableModel
ignores DataSet
Columns
that aren't visible in any column operations in the TableModel
.
JTable jTable = new JTable(); DBTableModel DBTableModel = new DBTableModel(); TableDataSet tableDataSet = new TableDataSet(); DBTableModel.setDataSet(tableDataSet); jTable.setModel(DBTableModel);
JdbTable
public DBTableModel()Constructs a
DBTableModel
and with a null
DataSet
. Calls the constructor of this
class that takes a DataSet
as a parameter and passes it null.
public DBTableModel(DataSet dataSet)Constructs a
DBTableModel
using the specified DataSet
. Calls the null
constructor of its superclass.
DataSet
DataSet
from which the DBTableModel
obtains its data.
public int getColumnCount()Returns the number of columns in the model, which is equal to the number of visible
Columns
in the DataSet
.
public DataSet getDataSet() public void setDataSet(DataSet dataSet)Returns and sets the
DataSet
used to build this table model.
public int getRowCount()Returns the number of rows in the model, which is equal to the number of rows in the
DataSet
.
protected void checkValue(Object aValue, int rowIndex, int columnIndex)The
checkValue()
method checks whether the given value satisfies the column formatter for the specified cell (i.e. dataset row and column). That is to
say, whether the value is valid for the corresponding type, or whether the value can be converted successfully to the data type of the target column. It also has the side effect of actually saving the value if the value can be converted to the proper type, or throwing an exception if not.
public Column getColumn(int columnIndex)Returns the
DataSet
Column
for the specified columnIndex
.
columnIndex
DataSet
.
protected boolean isValidDataSetState()Determines whether the
DataSet
is in a valid state. The DataSet
is valid (isValidDataSetState()
returns true
) if the value of dataSetChanged
is false
, there is a specified dataSet
value, and the specified DataSet
is open.
public boolean isValidValue(Object aValue, int rowIndex, int columnIndex)The
isValidValue()
method is just another entry point for checkValue()
to see if a
value can be converted to the proper dataset column type. The checkValue()
method is called at two different times, once before a user tries to end edit on a cell (the user won't be allowed to leave the cell
until the value is valid), and once before a value is actually written into a dataset via DBTableModel
. Note that the first case only applies if an edit mask is defined for the column, but the second case happens all the time, including when an application tries to write to a dataset using the
DBTableModel
directly.
public void addTableModelListener(javax.swing.event.TableModelListener ) public void removeTableModelListener(javax.swing.event.TableModelListener )