org.apache.tapestry.contrib.table.components
Class TableColumns

java.lang.Object
  |
  +--org.apache.tapestry.spec.BaseLocatable
        |
        +--org.apache.tapestry.AbstractComponent
              |
              +--org.apache.tapestry.BaseComponent
                    |
                    +--org.apache.tapestry.contrib.table.components.AbstractTableViewComponent
                          |
                          +--org.apache.tapestry.contrib.table.components.TableColumns
All Implemented Interfaces:
EventListener, IComponent, ILocatable, ILocationHolder, IRender, PageDetachListener

public class TableColumns
extends AbstractTableViewComponent
implements PageDetachListener

A low level Table component that renders the column headers in the table. This component must be wrapped by TableView.

The component iterates over all column objects in the ITableColumnModel and renders a header for each one of them using the renderer provided by the getColumnRender() method in ITableColumn. The headers are wrapped in 'th' tags by default.

Parameter Type Direction Required Default Description
element String in no th The tag to use to wrap the column headers.
column ITableColumn out no   The object representing the current column.
arrowUpAsset IAsset in no   The image to use to describe a column sorted in an ascending order.
arrowDownAsset IAsset in no   The image to use to describe a column sorted in a descending order.

Version:
$Id: TableColumns.java,v 1.3 2003/05/21 23:40:22 hlship Exp $
Author:
mindbridge

Field Summary
static String TABLE_COLUMN_ARROW_DOWN_ATTRIBUTE
           
static String TABLE_COLUMN_ARROW_UP_ATTRIBUTE
           
 
Constructor Summary
TableColumns()
           
 
Method Summary
 IAsset getArrowDownAsset()
          Returns the arrowDownAsset.
 IAsset getArrowUpAsset()
          Returns the arrowUpAsset.
 IBinding getColumnBinding()
          Returns the valueBinding.
 String getElement()
          Returns the element.
 IBinding getElementBinding()
          Returns the elementBinding.
 ITableColumn getTableColumn()
          Returns the tableColumn.
 Iterator getTableColumnIterator()
           
 IRender getTableColumnRenderer()
           
protected  void initialize()
           
 void pageDetached(PageEvent event)
          Invoked by the page from its IPage.detach() method.
protected  void renderComponent(IMarkupWriter writer, IRequestCycle cycle)
          Renders the top level components contained by the receiver.
 void setArrowDownAsset(IAsset arrowDownAsset)
          Sets the asset to use to render an image describing a column sorted in a descending order.
 void setArrowUpAsset(IAsset arrowUpAsset)
          Sets the asset to use to render an image describing a column sorted in an ascending order.
 void setColumnBinding(IBinding valueBinding)
          Sets the valueBinding.
 void setElementBinding(IBinding elementBinding)
          Sets the elementBinding.
 void setTableColumn(ITableColumn tableColumn)
          Sets the tableColumn.
 
Methods inherited from class org.apache.tapestry.contrib.table.components.AbstractTableViewComponent
getTableModelSource
 
Methods inherited from class org.apache.tapestry.BaseComponent
addOuter, finishLoad
 
Methods inherited from class org.apache.tapestry.AbstractComponent
addAsset, addBody, addComponent, cleanupAfterRender, finishLoad, fireObservedChange, fireObservedChange, fireObservedChange, fireObservedChange, fireObservedChange, fireObservedChange, fireObservedChange, fireObservedChange, fireObservedChange, format, format, format, format, formatString, formatString, formatString, formatString, generateAttributes, getAsset, getAssets, getBeans, getBinding, getBindingNames, getBindings, getBody, getBodyCount, getChangeObserver, getComponent, getComponents, getContainer, getExtendedId, getId, getIdPath, getListeners, getMessage, getMessages, getNamespace, getPage, getProperty, getSpecification, getString, pageEndRender, prepareForRender, render, renderBody, renderInformalParameters, setBinding, setContainer, setId, setNamespace, setPage, setProperty, setSpecification, toString
 
Methods inherited from class org.apache.tapestry.spec.BaseLocatable
getLocation, setLocation
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface org.apache.tapestry.ILocationHolder
setLocation
 
Methods inherited from interface org.apache.tapestry.ILocatable
getLocation
 

Field Detail

TABLE_COLUMN_ARROW_UP_ATTRIBUTE

public static final String TABLE_COLUMN_ARROW_UP_ATTRIBUTE

TABLE_COLUMN_ARROW_DOWN_ATTRIBUTE

public static final String TABLE_COLUMN_ARROW_DOWN_ATTRIBUTE
Constructor Detail

TableColumns

public TableColumns()
Method Detail

pageDetached

public void pageDetached(PageEvent event)
Description copied from interface: PageDetachListener
Invoked by the page from its IPage.detach() method.
Specified by:
pageDetached in interface PageDetachListener
See Also:
PageDetachListener.pageDetached(PageEvent)

initialize

protected void initialize()

getTableColumnIterator

public Iterator getTableColumnIterator()

getTableColumn

public ITableColumn getTableColumn()
Returns the tableColumn.
Returns:
ITableColumn

setTableColumn

public void setTableColumn(ITableColumn tableColumn)
Sets the tableColumn.
Parameters:
tableColumn - The tableColumn to set

getTableColumnRenderer

public IRender getTableColumnRenderer()

getColumnBinding

public IBinding getColumnBinding()
Returns the valueBinding.
Returns:
IBinding

setColumnBinding

public void setColumnBinding(IBinding valueBinding)
Sets the valueBinding.
Parameters:
valueBinding - The valueBinding to set

getElementBinding

public IBinding getElementBinding()
Returns the elementBinding.
Returns:
IBinding

setElementBinding

public void setElementBinding(IBinding elementBinding)
Sets the elementBinding.
Parameters:
elementBinding - The elementBinding to set

getElement

public String getElement()
Returns the element.
Returns:
String

getArrowDownAsset

public IAsset getArrowDownAsset()
Returns the arrowDownAsset.
Returns:
IAsset

getArrowUpAsset

public IAsset getArrowUpAsset()
Returns the arrowUpAsset.
Returns:
IAsset

setArrowDownAsset

public void setArrowDownAsset(IAsset arrowDownAsset)
Sets the asset to use to render an image describing a column sorted in a descending order.
Parameters:
arrowDownAsset - The asset of a 'down' arrow image

setArrowUpAsset

public void setArrowUpAsset(IAsset arrowUpAsset)
Sets the asset to use to render an image describing a column sorted in an ascending order.
Parameters:
arrowUpAsset - The asset of an 'up' arrow image

renderComponent

protected void renderComponent(IMarkupWriter writer,
                               IRequestCycle cycle)
Description copied from class: BaseComponent
Renders the top level components contained by the receiver.
Overrides:
renderComponent in class BaseComponent
See Also:
BaseComponent.renderComponent(IMarkupWriter, IRequestCycle)