proper.gui.core.table
Class ResultSetTableModel

java.lang.Object
  extended by proper.gui.core.table.ResultSetTableModel
All Implemented Interfaces:
javax.swing.table.TableModel

public class ResultSetTableModel
extends java.lang.Object
implements javax.swing.table.TableModel

The model for SQL ResultSet.

Version:
$Revision: 1.2 $
Author:
FracPete

Constructor Summary
ResultSetTableModel(java.sql.ResultSet rs)
          initializes the object
 
Method Summary
 void addTableModelListener(javax.swing.event.TableModelListener l)
          adds a listener to the list that is notified each time a change to data model occurs
 java.lang.Class getColumnClass(int columnIndex)
          returns the most specific superclass for all the cell values in the column (always String)
 int getColumnCount()
          returns the number of columns in the model
 java.lang.String getColumnName(int columnIndex)
          returns the name of the column at columnIndex
 int getRowCount()
          returns the number of rows in the model
 java.lang.Object getValueAt(int rowIndex, int columnIndex)
          returns the value for the cell at columnindex and rowIndex
 boolean isCellEditable(int rowIndex, int columnIndex)
          returns true if the cell at rowindex and columnindexis editable
 void removeTableModelListener(javax.swing.event.TableModelListener l)
          removes a listener from the list that is notified each time a change to the data model occurs
 void setValueAt(java.lang.Object aValue, int rowIndex, int columnIndex)
          sets the value in the cell at columnIndex and rowIndex to aValue.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ResultSetTableModel

public ResultSetTableModel(java.sql.ResultSet rs)
initializes the object

Method Detail

addTableModelListener

public void addTableModelListener(javax.swing.event.TableModelListener l)
adds a listener to the list that is notified each time a change to data model occurs

Specified by:
addTableModelListener in interface javax.swing.table.TableModel

getColumnClass

public java.lang.Class getColumnClass(int columnIndex)
returns the most specific superclass for all the cell values in the column (always String)

Specified by:
getColumnClass in interface javax.swing.table.TableModel

getColumnCount

public int getColumnCount()
returns the number of columns in the model

Specified by:
getColumnCount in interface javax.swing.table.TableModel

getColumnName

public java.lang.String getColumnName(int columnIndex)
returns the name of the column at columnIndex

Specified by:
getColumnName in interface javax.swing.table.TableModel

getRowCount

public int getRowCount()
returns the number of rows in the model

Specified by:
getRowCount in interface javax.swing.table.TableModel

getValueAt

public java.lang.Object getValueAt(int rowIndex,
                                   int columnIndex)
returns the value for the cell at columnindex and rowIndex

Specified by:
getValueAt in interface javax.swing.table.TableModel

isCellEditable

public boolean isCellEditable(int rowIndex,
                              int columnIndex)
returns true if the cell at rowindex and columnindexis editable

Specified by:
isCellEditable in interface javax.swing.table.TableModel

removeTableModelListener

public void removeTableModelListener(javax.swing.event.TableModelListener l)
removes a listener from the list that is notified each time a change to the data model occurs

Specified by:
removeTableModelListener in interface javax.swing.table.TableModel

setValueAt

public void setValueAt(java.lang.Object aValue,
                       int rowIndex,
                       int columnIndex)
sets the value in the cell at columnIndex and rowIndex to aValue. but only the value and the value can be changed

Specified by:
setValueAt in interface javax.swing.table.TableModel