|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectjavax.swing.table.AbstractTableModel
com.nqadmin.swingSet.SSTableModel
public class SSTableModel
SSTableModel.java
SwingSet - Open Toolkit For Making Swing Controls Database-Aware
SSTableModel provides an implementation of the TableModel interface. The SSDataGrid uses this class for providing a grid view for a SSRowSet. SSTableModel can be used without the SSDataGrid (e.g. in conjunction with a JTable), but the cell renderers and hidden columns features of the SSDataGrid will not be available. SSTableModel can be used with a JTable to get a Grid view of the data.
| Constructor Summary | |
|---|---|
SSTableModel()
Constructs a SSTableModel object. |
|
SSTableModel(SSRowSet _rowset)
Constructs a SSTableModel object with the given SSRowSet. |
|
| Method Summary | |
|---|---|
boolean |
deleteRow(int _row)
Deletes the specified row from the database. |
java.lang.Class |
getColumnClass(int _column)
Returns the type for the column specified for the current view. |
int |
getColumnCount()
Returns the number of columns in the model. |
java.lang.String |
getColumnName(int _columnNumber)
Returns the name of the column appearing in the view at column position column. |
java.lang.Object |
getDefaultValue(int _columnNumber)
Returns the default value inforce for the requested column. |
int |
getRowCount()
Returns the number of rows in the model. |
java.lang.Object |
getValueAt(int _row,
int _column)
Returns the value for the cell at the specified row & column. |
boolean |
isCellEditable(int _row,
int _column)
Returns true if the cell at rowIndex and columnIndex is editable. |
void |
setDefaultValues(int[] _columnNumbers,
java.lang.Object[] _values)
Sets the default values for different columns. |
void |
setHeaders(java.lang.String[] _headers)
Sets the headers for the JTable. |
void |
setHiddenColumns(int[] _columnNumbers)
Sets the column numbers that should be hidden. |
void |
setInsertion(boolean _insert)
Sets row insertion indicator. |
void |
setJTable(javax.swing.JTable _table)
This sets the JTable to which the table model is bound to. |
void |
setMessageWindow(java.awt.Component _component)
Sets the message window. |
void |
setPrimaryColumn(int _columnNumber)
Sets the column number which is the primary column for the table. |
void |
setRowSet(SSRowSet _rowset)
Deprecated. |
void |
setSSCellEditing(SSCellEditing _cellEditing)
Used to set an implementation of SSCellEditing interface which can be used to determine dynamically if a given cell can be edited and to determine if a given value is valid. |
void |
setSSDataValue(SSDataValue _dataValue)
Sets the SSDataValue interface implemention. |
void |
setSSRowSet(SSRowSet _rowset)
Sets the SSRowSet for SSTableModel to the given SSRowSet. |
void |
setUneditableColumns(int[] _columnNumbers)
Sets the uneditable columns. |
void |
setValueAt(java.lang.Object _value,
int _row,
int _column)
Sets the value in the cell at _row and _column to _value. |
| 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 |
|---|
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public SSTableModel()
public SSTableModel(SSRowSet _rowset)
throws java.sql.SQLException
_rowset - SSRowSet object whose records has to be displayed in JTable.
java.sql.SQLException| Method Detail |
|---|
public void setSSRowSet(SSRowSet _rowset)
throws java.sql.SQLException
_rowset - SSRowSet object whose records has to be displayed in JTable.
java.sql.SQLExceptionpublic void setSSCellEditing(SSCellEditing _cellEditing)
_cellEditing - implementation of SSCellEditing interface.public void setInsertion(boolean _insert)
_insert - true if user can insert new rows, else false.public int getColumnCount()
public int getRowCount()
public boolean isCellEditable(int _row,
int _column)
isCellEditable in interface javax.swing.table.TableModelisCellEditable in class javax.swing.table.AbstractTableModel_row - the row whose value to be queried_column - the column whose value to be queried
public java.lang.Object getValueAt(int _row,
int _column)
_row - the row whose value to be queried._column - the column whose value to be queried.
public void setValueAt(java.lang.Object _value,
int _row,
int _column)
setValueAt in interface javax.swing.table.TableModelsetValueAt in class javax.swing.table.AbstractTableModel_value - the new value_row - the row whose value is to be changed_column - the column whose value is to be changedpublic java.lang.Class getColumnClass(int _column)
getColumnClass in interface javax.swing.table.TableModelgetColumnClass in class javax.swing.table.AbstractTableModel_column - the column in the view being queried
public boolean deleteRow(int _row)
_row - the row number that has to be deleted.
public void setDefaultValues(int[] _columnNumbers,
java.lang.Object[] _values)
_columnNumbers - the column numbers for which defaults are required_values - the values for all the columns specified in first argumentpublic java.lang.Object getDefaultValue(int _columnNumber)
_columnNumber - the column number for which default value is needed.
public void setMessageWindow(java.awt.Component _component)
_component - the component that should be used for message dialogs.public void setJTable(javax.swing.JTable _table)
_table - JTable to which SSTableModel is bound to.public void setPrimaryColumn(int _columnNumber)
_columnNumber - the column which is the primary column.public void setSSDataValue(SSDataValue _dataValue)
_dataValue - implementation of SSDataValue for determining PKpublic void setHeaders(java.lang.String[] _headers)
_headers - array of string objects representing the header for each column.public java.lang.String getColumnName(int _columnNumber)
getColumnName in interface javax.swing.table.TableModelgetColumnName in class javax.swing.table.AbstractTableModel_columnNumber - the column in the view being queried
public void setUneditableColumns(int[] _columnNumbers)
_columnNumbers - array specifying the column numbers which should be
uneditable.public void setHiddenColumns(int[] _columnNumbers)
_columnNumbers - array specifying the column numbers which should be
hidden.
public void setRowSet(SSRowSet _rowset)
throws java.sql.SQLException
_rowset - SSRowSet object whose records has to be displayed in JTable.
java.sql.SQLExceptionsetSSRowSet(com.nqadmin.swingSet.datasources.SSRowSet)
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||