EchoPoint
1.0

echopoint.table
Interface PagedTableModel

All Superinterfaces:
nextapp.echo.table.TableModel
All Known Implementing Classes:
DefaultPagedTableModel, SortablePagedTableModel

public interface PagedTableModel
extends nextapp.echo.table.TableModel

PagedTableModel interface defines a TableModel that can be divided in "pages" of row data. Typically it will report back the number of rows per page via the getRowCount() method.

The actual total number of rows is provided by the getTotalRowCount() method.


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.
 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 rowsPerPage)
          Sets the number of rows per page.
 
Methods inherited from interface nextapp.echo.table.TableModel
addTableModelListener, getColumnClass, getColumnCount, getColumnName, getValueAt, removeTableModelListener
 

Method Detail

previous

public void previous()
Move back a page, rolling over to getMaxPageIndex from 0


next

public void next()
Move forward a page, rolling over to 0 from getMaxPageIndex


getRowsPerPage

public int getRowsPerPage()
Gets the number of rows per page.

Returns:
- the number of rows per page.

setRowsPerPage

public void setRowsPerPage(int rowsPerPage)
Sets the number of rows per page. Any integer value is fine since this just defines the viewable upper bound.

Parameters:
rowsPerPage - - the number of rows per page

getPageIndex

public int getPageIndex()
Gets the current page index.

Returns:
the current page index

setPageIndex

public void setPageIndex(int pageIndex)
Sets the current page index. This method will safely roll to the max page or 0 depending on the given value being and over or under flow respectively.

Parameters:
pageIndex - - the new page index

getMaxPageIndex

public int getMaxPageIndex()
Gets the maximum number of pages that this model contains.

Returns:
the maximum number of pages that this model contains.

getRowCount

public 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.

Constrast 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.

Specified by:
getRowCount in interface nextapp.echo.table.TableModel
See Also:
TableModel.getRowCount()

getTotalRowCount

public int getTotalRowCount()
Returns the total number of rows in the TableModel.

Contrasts this with the getRowCount() method.

Returns:
the total number of rows in the TableModel.
See Also:
getRowCount(), TableModel.getRowCount()

EchoPoint
1.0