org.apache.tapestry.contrib.table.model.common
Class AbstractTableColumn

java.lang.Object
  |
  +--org.apache.tapestry.contrib.table.model.common.AbstractTableColumn
All Implemented Interfaces:
ITableColumn, Serializable
Direct Known Subclasses:
SimpleTableColumn

public class AbstractTableColumn
extends Object
implements ITableColumn, Serializable

A base implementation of ITableColumn that allows renderers to be set via aggregation.

Since:
2.3
Version:
$Id: AbstractTableColumn.java,v 1.2 2003/05/16 18:54:22 hlship Exp $
Author:
mindbridge
See Also:
ITableRendererSource, Serialized Form

Constructor Summary
AbstractTableColumn()
           
AbstractTableColumn(String strColumnName, boolean bSortable, Comparator objComparator)
           
AbstractTableColumn(String strColumnName, boolean bSortable, Comparator objComparator, ITableRendererSource objColumnRendererSource, ITableRendererSource objValueRendererSource)
           
 
Method Summary
 String getColumnName()
          Method getColumnName provides the name of the column.
 IRender getColumnRenderer(IRequestCycle objCycle, ITableModelSource objSource)
          Method getColumnRenderer provides a renderer that takes care of rendering the column in the table header.
 ITableRendererSource getColumnRendererSource()
          Returns the columnRendererSource.
 Comparator getComparator()
          Method getComparator returns the Comparator to be used to sort the data in the table according to this column.
 boolean getSortable()
          Method getSortable declares whether the column allows sorting.
 IRender getValueRenderer(IRequestCycle objCycle, ITableModelSource objSource, Object objRow)
          Method getValueRenderer provides a renderer for presenting the value of a particular row in the current column.
 ITableRendererSource getValueRendererSource()
          Returns the valueRendererSource.
 void setColumnName(String columnName)
          Sets the columnName.
 void setColumnRendererSource(ITableRendererSource columnRendererSource)
          Sets the columnRendererSource.
 void setComparator(Comparator comparator)
          Sets the comparator.
 void setSortable(boolean sortable)
          Sets whether the column is sortable.
 void setValueRendererSource(ITableRendererSource valueRendererSource)
          Sets the valueRendererSource.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

AbstractTableColumn

public AbstractTableColumn()

AbstractTableColumn

public AbstractTableColumn(String strColumnName,
                           boolean bSortable,
                           Comparator objComparator)

AbstractTableColumn

public AbstractTableColumn(String strColumnName,
                           boolean bSortable,
                           Comparator objComparator,
                           ITableRendererSource objColumnRendererSource,
                           ITableRendererSource objValueRendererSource)
Method Detail

getColumnName

public String getColumnName()
Description copied from interface: ITableColumn
Method getColumnName provides the name of the column. The column name must be unique and is generally used for the identification of the column. It does not have to be the same as the display name via which the column is identified to the user (see the getColumnRender() method).
Specified by:
getColumnName in interface ITableColumn
See Also:
ITableColumn.getColumnName()

setColumnName

public void setColumnName(String columnName)
Sets the columnName.
Parameters:
columnName - The columnName to set

getSortable

public boolean getSortable()
Description copied from interface: ITableColumn
Method getSortable declares whether the column allows sorting. If the column allows sorting, it must also return a valid Comparator via the getComparator() method.
Specified by:
getSortable in interface ITableColumn
See Also:
ITableColumn.getSortable()

setSortable

public void setSortable(boolean sortable)
Sets whether the column is sortable.
Parameters:
sortable - The sortable flag to set

getComparator

public Comparator getComparator()
Description copied from interface: ITableColumn
Method getComparator returns the Comparator to be used to sort the data in the table according to this column. The Comparator must accept two different rows, compare them according to this column, and return the appropriate value.
Specified by:
getComparator in interface ITableColumn
See Also:
ITableColumn.getComparator()

setComparator

public void setComparator(Comparator comparator)
Sets the comparator.
Parameters:
comparator - The comparator to set

getColumnRenderer

public IRender getColumnRenderer(IRequestCycle objCycle,
                                 ITableModelSource objSource)
Description copied from interface: ITableColumn
Method getColumnRenderer provides a renderer that takes care of rendering the column in the table header. If the column is sortable, the renderer may provide a mechanism to sort the table in an ascending or descending manner.
Specified by:
getColumnRenderer in interface ITableColumn
See Also:
ITableColumn.getColumnRenderer(IRequestCycle, ITableModelSource)

getValueRenderer

public IRender getValueRenderer(IRequestCycle objCycle,
                                ITableModelSource objSource,
                                Object objRow)
Description copied from interface: ITableColumn
Method getValueRenderer provides a renderer for presenting the value of a particular row in the current column.
Specified by:
getValueRenderer in interface ITableColumn
See Also:
ITableColumn.getValueRenderer(IRequestCycle, ITableModelSource, Object)

getColumnRendererSource

public ITableRendererSource getColumnRendererSource()
Returns the columnRendererSource.
Returns:
ITableColumnRendererSource

setColumnRendererSource

public void setColumnRendererSource(ITableRendererSource columnRendererSource)
Sets the columnRendererSource.
Parameters:
columnRendererSource - The columnRendererSource to set

getValueRendererSource

public ITableRendererSource getValueRendererSource()
Returns the valueRendererSource.
Returns:
ITableValueRendererSource

setValueRendererSource

public void setValueRendererSource(ITableRendererSource valueRendererSource)
Sets the valueRendererSource.
Parameters:
valueRendererSource - The valueRendererSource to set