|
SPT RWT Application API | |||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectnextapp.echo2.app.table.AbstractTableModel
com.sptci.echo2.table.AbstractTableModel<D>
com.sptci.echo2.table.TableModel<D>
com.sptci.echo2.table.DefaultPageableTableModel<Row>
com.sptci.rwt.webui.RowTableModel
public class RowTableModel
A custom table model used to display Row objects.
© Copyright 2007 Sans Pareil Technologies, Inc.
| Field Summary | |
|---|---|
protected ConnectionManager |
manager
The connection manager to use to fetch database connections. |
protected int |
maxColumnLength
The maximum number of characters to display in a column. |
protected int |
maxRows
The maximum number of records to fetch from the database. |
protected String |
query
The SQL statement that is to be executed to fetch the results. |
| Fields inherited from class com.sptci.echo2.table.DefaultPageableTableModel |
|---|
page, pageSize, totalRows |
| Fields inherited from class com.sptci.echo2.table.TableModel |
|---|
columns, data |
| Fields inherited from class com.sptci.echo2.table.AbstractTableModel |
|---|
sortDirection, sortIndex |
| Constructor Summary | |
|---|---|
protected |
RowTableModel()
Default constructor. |
|
RowTableModel(String query,
int maxRows,
int maxColumnLength,
ConnectionManager manager)
Create a new instance of the table model using the specified collection of Row objects. |
| Method Summary | |
|---|---|
protected void |
fetchData()
Fetch the data from the database by executing query. |
String |
getColumnName(int column)
Return the column name to display at the specified index. |
ConnectionManager |
getManager()
Returns manager. |
int |
getMaxColumnLength()
Returns maxColumnLength. |
int |
getMaxRows()
Returns maxRows. |
String |
getQuery()
Returns query. |
long |
getTotalRows()
Returns DefaultPageableTableModel.totalRows. |
Object |
getValueAt(int column,
int row)
Return the value to display at the coordinates specified. |
protected void |
processColumns()
Over-ridden to set the proper column meta data using the column information from the row object. |
void |
setPage(int page)
Set DefaultPageableTableModel.page. |
void |
setPageSize(int pageSize)
Set DefaultPageableTableModel.pageSize. |
| Methods inherited from class com.sptci.echo2.table.DefaultPageableTableModel |
|---|
getPage, getPageSize, getTotalPages |
| Methods inherited from class com.sptci.echo2.table.TableModel |
|---|
addRow, deleteRow, deleteRow, getColumnAnnotations, getColumnClass, getColumnCount, getObjectAt, getRowCount, init, insertRow, processColumnAnnotations, processColumnsAnnotation, processFields, updateRow |
| Methods inherited from class com.sptci.echo2.table.AbstractTableModel |
|---|
getSortDirection |
| Methods inherited from class nextapp.echo2.app.table.AbstractTableModel |
|---|
addTableModelListener, fireTableCellUpdated, fireTableChanged, fireTableDataChanged, fireTableRowsDeleted, fireTableRowsInserted, fireTableRowsUpdated, fireTableStructureChanged, getEventListenerList, removeTableModelListener |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
protected final String query
protected final int maxRows
protected final int maxColumnLength
protected final ConnectionManager manager
| Constructor Detail |
|---|
protected RowTableModel()
public RowTableModel(String query,
int maxRows,
int maxColumnLength,
ConnectionManager manager)
throws QueryException
Row objects.
query - The sql statement that is to be executed to fetch any
additional pages of data.maxRows - The maximum number of rows to fetch from the
result set.maxColumnLength - The maximum number of characters to display in
a column.manager - The manager to use to fetch database connections.
QueryException - If errors are encountered while executing
the query.fetchData(),
processColumns()| Method Detail |
|---|
protected void fetchData()
throws QueryException
query.
QueryException - If errors are encountered while executing
the query.AbstractTableModel.fireTableDataChanged(),
QueryExecutorprotected void processColumns()
processColumns in class com.sptci.echo2.table.TableModel<Row>public String getColumnName(int column)
getColumnName in interface TableModelgetColumnName in class com.sptci.echo2.table.TableModel<Row>column - The column index for which the name is required.
public Object getValueAt(int column,
int row)
getValueAt in interface TableModelgetValueAt in class com.sptci.echo2.table.TableModel<Row>column - The column index.row - The row index.
RuntimeException - If the indices are invalid.public String getQuery()
query.
public int getMaxRows()
maxRows.
public int getMaxColumnLength()
maxColumnLength.
public ConnectionManager getManager()
manager.
public long getTotalRows()
DefaultPageableTableModel.totalRows.
public void setPage(int page)
DefaultPageableTableModel.page.
page - The value to set.fetchData()public void setPageSize(int pageSize)
DefaultPageableTableModel.pageSize.
pageSize - The value to set.fetchData()
|
SPT RWT Application API | |||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||