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

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

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(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 getRowCount()
          Returns the total number of rows / values this model is managing.
 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(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

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 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()
Description copied from interface: ITableModel
Returns the total number of rows / values this model is managing.

Specified by:
getRowCount in interface ITableModel
Returns:
The total number of rows - if known.

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


Copyright © 2006-2008 Apache Software Foundation. All Rights Reserved.