|
EchoPoint 1.0 |
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectnextapp.echo.table.AbstractTableModel
echopoint.table.TableModelAdapter
echopoint.table.DefaultPagedTableModel
The DefaultPagedTableModel is a PagedTabledModel that
can be used to display a subset (ie. a page worth) of data at a time from an
underlying TableModel.
Notes on using DefaultPagedTableModel in a SortableTable :
The SortableTable works by wrapping the underlying data model into a SortableTableModel and then sorting it. If you use this table model, then it will only sort a page size at a time, not the whole table and then present a page size. In other words what you see on the screen at any one time will be sorted, however the total table model will not be sorted.
You can get around this by using the very related class
SortablePagedTableModel. This sorts the underlying
TableModel and then displays a page at a time.
| Field Summary |
| Fields inherited from class echopoint.table.TableModelAdapter |
model |
| Fields inherited from class nextapp.echo.table.AbstractTableModel |
listenerList |
| Constructor Summary | |
DefaultPagedTableModel(nextapp.echo.table.TableModel model)
Creates a DefaultPagedTableModel that pages over the provided TableMode with a default page size of Integer.MAX_VALUE. |
|
DefaultPagedTableModel(nextapp.echo.table.TableModel model,
int pageSize)
Creates a DefaultPagedTableModel that pages over the provided TableModel with a default page size of pageSize. |
|
| Method Summary | |
int |
getMaxPageIndex()
Gets the maximum number of pages that this model contains. |
int |
getPageIndex()
Gets the current page index. |
int |
getRowCount()
In a PagedTableModel, this reports the minimum of the current rows per page or the number of rows left in the current page. |
int |
getRowsPerPage()
Gets the number of rows per page. |
int |
getTotalRowCount()
Returns the total number of rows in the TableModel. |
java.lang.Object |
getValueAt(int column,
int row)
|
void |
next()
Move forward a page, rolling over to 0 from getMaxPageIndex |
void |
previous()
Move back a page, rolling over to getMaxPageIndex from 0 |
void |
setPageIndex(int pageIndex)
Sets the current page index. |
void |
setRowsPerPage(int pageSize)
Sets the number of rows per page. |
| Methods inherited from class echopoint.table.TableModelAdapter |
deleteRow, getColumnClass, getColumnCount, getColumnName, getModel, insertRow, setModel, tableChanged |
| Methods inherited from class nextapp.echo.table.AbstractTableModel |
addTableModelListener, fireTableCellUpdated, fireTableChanged, fireTableDataChanged, fireTableRowsDeleted, fireTableRowsInserted, fireTableRowsUpdated, fireTableStructureChanged, removeTableModelListener |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Methods inherited from interface nextapp.echo.table.TableModel |
addTableModelListener, getColumnClass, getColumnCount, getColumnName, removeTableModelListener |
| Constructor Detail |
public DefaultPagedTableModel(nextapp.echo.table.TableModel model)
model - - the underlying TabeModel to page
public DefaultPagedTableModel(nextapp.echo.table.TableModel model,
int pageSize)
model - - the underlying TabeModel to pagepageSize - - the number of rows in a page| Method Detail |
public void previous()
PagedTableModel
previous in interface PagedTableModelPagedTableModel.previous()public void next()
PagedTableModel
next in interface PagedTableModelPagedTableModel.next()public int getRowsPerPage()
PagedTableModel
getRowsPerPage in interface PagedTableModelPagedTableModel.getRowsPerPage()public void setRowsPerPage(int pageSize)
PagedTableModel
setRowsPerPage in interface PagedTableModelpageSize - - the number of rows per pagePagedTableModel.setRowsPerPage(int)public int getPageIndex()
PagedTableModel
getPageIndex in interface PagedTableModelPagedTableModel.getPageIndex()public void setPageIndex(int pageIndex)
PagedTableModel
setPageIndex in interface PagedTableModelpageIndex - - the new page indexPagedTableModel.setPageIndex(int)public int getMaxPageIndex()
PagedTableModel
getMaxPageIndex in interface PagedTableModelPagedTableModel.getMaxPageIndex()public int getTotalRowCount()
PagedTableModelContrasts this with the getRowCount() method.
getTotalRowCount in interface PagedTableModelPagedTableModel.getTotalRowCount()public int getRowCount()
PagedTableModelConstrast this with the original getRowCount() which reports the total number of rows in the model. This is needed to "trick" the visual Table component into thinking it sees a complete model of row data, when in fact it only sees a page.
getRowCount in interface PagedTableModelgetRowCount in class TableModelAdapterTableModel.getRowCount()
public java.lang.Object getValueAt(int column,
int row)
getValueAt in interface nextapp.echo.table.TableModelgetValueAt in class TableModelAdapterTableModel.getValueAt(int, int)
|
EchoPoint 1.0 |
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||