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

java.lang.Object
  extended byorg.apache.tapestry.contrib.table.model.common.AbstractTableModel
      extended byorg.apache.tapestry.contrib.table.model.simple.SimpleTableModel
All Implemented Interfaces:
IFullTableModel, ITableDataModelListener, ITableModel, java.io.Serializable

public class SimpleTableModel
extends AbstractTableModel
implements IFullTableModel, ITableDataModelListener

A simple generic table model implementation.

Author:
mindbridge
See Also:
Serialized Form

Constructor Summary
SimpleTableModel(ITableDataModel objDataModel, ITableColumnModel objColumnModel)
           
SimpleTableModel(ITableDataModel objDataModel, ITableColumnModel objColumnModel, SimpleTableState objState)
           
SimpleTableModel(java.lang.Object[] arrData, ITableColumn[] arrColumns)
           
SimpleTableModel(java.lang.Object[] arrData, ITableColumnModel objColumnModel)
           
 
Method Summary
 ITableColumnModel getColumnModel()
          Method getColumnModel.
 java.util.Iterator getCurrentPageRows()
          Method getCurrentPageRows.
 ITableDataModel getDataModel()
          Returns the dataModel.
 int getRowCount()
           
 java.util.Iterator getRows()
          Iterates over all of the rows in the model
 void setDataModel(ITableDataModel dataModel)
          Sets the dataModel.
protected  void sortRows()
           
 void tableDataChanged(CTableDataModelEvent objEvent)
           
 
Methods inherited from class org.apache.tapestry.contrib.table.model.common.AbstractTableModel
getPageCount, getPagingState, getSortingState, getState
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface org.apache.tapestry.contrib.table.model.ITableModel
getPageCount, getPagingState, getSortingState
 

Constructor Detail

SimpleTableModel

public SimpleTableModel(java.lang.Object[] arrData,
                        ITableColumn[] arrColumns)

SimpleTableModel

public SimpleTableModel(java.lang.Object[] arrData,
                        ITableColumnModel objColumnModel)

SimpleTableModel

public SimpleTableModel(ITableDataModel objDataModel,
                        ITableColumnModel objColumnModel)

SimpleTableModel

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

getColumnModel

public ITableColumnModel getColumnModel()
Description copied from interface: ITableModel
Method getColumnModel.

Specified by:
getColumnModel in interface ITableModel
Returns:
ITableColumnModel the column model of the table

getCurrentPageRows

public java.util.Iterator getCurrentPageRows()
Description copied from interface: ITableModel
Method getCurrentPageRows.

Specified by:
getCurrentPageRows in interface ITableModel
Returns:
Iterator the rows in the current table page given the current data, sorting, and paging state

getRowCount

public int getRowCount()
Specified by:
getRowCount in class AbstractTableModel

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

getRows

public java.util.Iterator getRows()
Description copied from interface: IFullTableModel
Iterates over all of the rows in the model

Specified by:
getRows in interface IFullTableModel
Returns:
Iterator the iterator for access to the data