org.apache.tapestry.contrib.table.model.simple
Class SimpleTableModel

java.lang.Object
  |
  +--org.apache.tapestry.contrib.table.model.simple.SimpleTableModel
All Implemented Interfaces:
ITableDataModelListener, ITableModel, Serializable

public class SimpleTableModel
extends Object
implements ITableModel, ITableDataModelListener, Serializable

A simple generic table model implementation.

Version:
$Id: SimpleTableModel.java,v 1.1 2003/03/05 23:03:04 hlship Exp $
Author:
mindbridge
See Also:
Serialized Form

Constructor Summary
SimpleTableModel(ITableDataModel objDataModel, ITableColumnModel objColumnModel)
           
SimpleTableModel(ITableDataModel objDataModel, ITableColumnModel objColumnModel, SimpleTableState objState)
           
SimpleTableModel(Object[] arrData, ITableColumn[] arrColumns)
           
SimpleTableModel(Object[] arrData, ITableColumnModel objColumnModel)
           
 
Method Summary
 ITableColumnModel getColumnModel()
          Method getColumnModel.
 Iterator getCurrentPageRows()
          Method getCurrentPageRows.
 ITableDataModel getDataModel()
          Returns the dataModel.
 int getPageCount()
          Method getPageCount.
 ITablePagingState getPagingState()
          Method getPagingState.
 int getRowCount()
           
 ITableSortingState getSortingState()
          Method getSortingState.
 SimpleTableState getState()
           
 void setDataModel(ITableDataModel dataModel)
          Sets the dataModel.
protected  void sortRows()
           
 void tableDataChanged(CTableDataModelEvent objEvent)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

SimpleTableModel

public SimpleTableModel(Object[] arrData,
                        ITableColumn[] arrColumns)

SimpleTableModel

public SimpleTableModel(Object[] arrData,
                        ITableColumnModel objColumnModel)

SimpleTableModel

public SimpleTableModel(ITableDataModel objDataModel,
                        ITableColumnModel objColumnModel)

SimpleTableModel

public SimpleTableModel(ITableDataModel objDataModel,
                        ITableColumnModel objColumnModel,
                        SimpleTableState objState)
Method Detail

getState

public SimpleTableState getState()

getColumnModel

public ITableColumnModel getColumnModel()
Description copied from interface: ITableModel
Method getColumnModel.
Specified by:
getColumnModel in interface ITableModel
Following copied from interface: org.apache.tapestry.contrib.table.model.ITableModel
Returns:
ITableColumnModel the column model of the table

getCurrentPageRows

public Iterator getCurrentPageRows()
Description copied from interface: ITableModel
Method getCurrentPageRows.
Specified by:
getCurrentPageRows in interface ITableModel
Following copied from interface: org.apache.tapestry.contrib.table.model.ITableModel
Returns:
Iterator the rows in the current table page given the current data, sorting, and paging state

getPageCount

public int getPageCount()
Description copied from interface: ITableModel
Method getPageCount.
Specified by:
getPageCount in interface ITableModel
Following copied from interface: org.apache.tapestry.contrib.table.model.ITableModel
Returns:
int the number of pages this table would have given the current data and paging state

getPagingState

public ITablePagingState getPagingState()
Description copied from interface: ITableModel
Method getPagingState.
Specified by:
getPagingState in interface ITableModel
Following copied from interface: org.apache.tapestry.contrib.table.model.ITableModel
Returns:
ITablePagingState the paging state of the table

getSortingState

public ITableSortingState getSortingState()
Description copied from interface: ITableModel
Method getSortingState.
Specified by:
getSortingState in interface ITableModel
Following copied from interface: org.apache.tapestry.contrib.table.model.ITableModel
Returns:
ITableSortingState the sorting state of the table

getRowCount

public int getRowCount()

sortRows

protected void sortRows()

tableDataChanged

public void tableDataChanged(CTableDataModelEvent objEvent)
Specified by:
tableDataChanged in interface ITableDataModelListener

getDataModel

public ITableDataModel getDataModel()
Returns the dataModel.
Returns:
ITableDataModel

setDataModel

public void setDataModel(ITableDataModel dataModel)
Sets the dataModel.
Parameters:
dataModel - The dataModel to set