com.billpringle.utils
Class WrpScrollResultSet.WrpScrollResultModel

java.lang.Object
  extended by javax.swing.table.AbstractTableModel
      extended by javax.swing.table.DefaultTableModel
          extended by com.billpringle.utils.WrpScrollTable.WrpTableModel
              extended by com.billpringle.utils.WrpScrollResultSet.WrpScrollResultModel
All Implemented Interfaces:
java.io.Serializable, javax.swing.table.TableModel
Enclosing class:
WrpScrollResultSet

public class WrpScrollResultSet.WrpScrollResultModel
extends WrpScrollTable.WrpTableModel

The table model for the scrolled result set.

Author:
Bill Pringle
See Also:
Serialized Form

Field Summary
private  java.lang.String[] colNames
          column names
private  int[] colScroll
          columns in scroll
private  java.lang.String[] colTypes
          column types
private  int ncols
          number of columns
private static long serialVersionUID
          sequencing serial version
private  WrpResultSetVector vec
          result set vector
 
Fields inherited from class javax.swing.table.DefaultTableModel
columnIdentifiers, dataVector
 
Fields inherited from class javax.swing.table.AbstractTableModel
listenerList
 
Constructor Summary
WrpScrollResultSet.WrpScrollResultModel(WrpResultSetVector v)
          Constructor for table model.
 
Method Summary
 void buildColScroll(int[] cols)
          Builds list of columns to display in scroll.
 java.lang.Class<?> getColumnClass(int col)
           
 int getColumnCount()
           
 java.lang.String getColumnName(int col)
           
 java.lang.String getDescription(int nrow)
          Returns description for specified entry.
 int getRowCount()
           
 java.lang.String getValueAt(int row, int col)
           
 boolean isCellEditable(int row, int col)
           
 void setVector(WrpResultSetVector v)
          Set the vector and extract information for model.
 
Methods inherited from class javax.swing.table.DefaultTableModel
addColumn, addColumn, addColumn, addRow, addRow, convertToVector, convertToVector, getDataVector, insertRow, insertRow, moveRow, newDataAvailable, newRowsAdded, removeRow, rowsRemoved, setColumnCount, setColumnIdentifiers, setColumnIdentifiers, setDataVector, setDataVector, setNumRows, setRowCount, setValueAt
 
Methods inherited from class javax.swing.table.AbstractTableModel
addTableModelListener, findColumn, fireTableCellUpdated, fireTableChanged, fireTableDataChanged, fireTableRowsDeleted, fireTableRowsInserted, fireTableRowsUpdated, fireTableStructureChanged, getListeners, getTableModelListeners, removeTableModelListener
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

serialVersionUID

private static final long serialVersionUID
sequencing serial version

See Also:
Constant Field Values

vec

private WrpResultSetVector vec
result set vector


ncols

private int ncols
number of columns


colNames

private java.lang.String[] colNames
column names


colTypes

private java.lang.String[] colTypes
column types


colScroll

private int[] colScroll
columns in scroll

Constructor Detail

WrpScrollResultSet.WrpScrollResultModel

public WrpScrollResultSet.WrpScrollResultModel(WrpResultSetVector v)
Constructor for table model.

Parameters:
v - the result set vector
Method Detail

setVector

public void setVector(WrpResultSetVector v)
Set the vector and extract information for model. This method handles null being passed for the vector.

Parameters:
v - result set vector

buildColScroll

public void buildColScroll(int[] cols)
Builds list of columns to display in scroll. If null is passed, then all columns are displayed.

Parameters:
cols - the column indices to display

getDescription

public java.lang.String getDescription(int nrow)
Description copied from class: WrpScrollTable.WrpTableModel
Returns description for specified entry. This method should be overridden by a subclass

Overrides:
getDescription in class WrpScrollTable.WrpTableModel
Parameters:
nrow - the location of the entry within the list
Returns:
the description to appear in the lower part of window

getRowCount

public int getRowCount()
Specified by:
getRowCount in interface javax.swing.table.TableModel
Overrides:
getRowCount in class javax.swing.table.DefaultTableModel

getColumnCount

public int getColumnCount()
Specified by:
getColumnCount in interface javax.swing.table.TableModel
Overrides:
getColumnCount in class javax.swing.table.DefaultTableModel

getValueAt

public java.lang.String getValueAt(int row,
                                   int col)
Specified by:
getValueAt in interface javax.swing.table.TableModel
Overrides:
getValueAt in class javax.swing.table.DefaultTableModel

getColumnName

public java.lang.String getColumnName(int col)
Specified by:
getColumnName in interface javax.swing.table.TableModel
Overrides:
getColumnName in class javax.swing.table.DefaultTableModel

isCellEditable

public boolean isCellEditable(int row,
                              int col)
Specified by:
isCellEditable in interface javax.swing.table.TableModel
Overrides:
isCellEditable in class javax.swing.table.DefaultTableModel

getColumnClass

public java.lang.Class<?> getColumnClass(int col)
Specified by:
getColumnClass in interface javax.swing.table.TableModel
Overrides:
getColumnClass in class javax.swing.table.AbstractTableModel