org.trails.component
Class ObjectTable

java.lang.Object
  extended by org.apache.hivemind.impl.BaseLocatable
      extended by org.apache.tapestry.AbstractComponent
          extended by org.apache.tapestry.BaseComponent
              extended by org.trails.component.TrailsComponent
                  extended by org.trails.component.ClassDescriptorComponent
                      extended by org.trails.component.ObjectTable
All Implemented Interfaces:
java.util.EventListener, org.apache.hivemind.Locatable, org.apache.hivemind.LocationHolder, org.apache.tapestry.event.PageBeginRenderListener, org.apache.tapestry.IComponent, org.apache.tapestry.IDirectEvent, org.apache.tapestry.internal.Component, org.apache.tapestry.IRender, org.apache.tapestry.ITemplateComponent

@ComponentClass(allowBody=true,
                allowInformalParameters=true)
public abstract class ObjectTable
extends ClassDescriptorComponent
implements org.apache.tapestry.event.PageBeginRenderListener

Produces a table for the list of instances


Field Summary
protected  java.util.List<org.apache.tapestry.contrib.table.model.ITableColumn> columns
           
static java.lang.String LINK_COLUMN
           
 
Fields inherited from class org.trails.component.TrailsComponent
DEFAULT
 
Fields inherited from class org.apache.tapestry.AbstractComponent
_body, _bodyCount
 
Constructor Summary
ObjectTable()
           
 
Method Summary
protected  void alterTableColumn(IPropertyDescriptor descriptor, TrailsTableColumn tableColumn)
          Hook method to allow subclasses to modify the tableColumn,
protected  org.apache.tapestry.contrib.table.model.ITableColumnModel generateTableColumnModel(java.lang.String strDesc)
          Generate a table column model out of the description string provided.
abstract  org.apache.tapestry.IAsset getArrowDownAsset()
          The image to use to describe a column sorted in a descending order.
abstract  org.apache.tapestry.IAsset getArrowUpAsset()
          The image to use to describe a column sorted in an ascending order.
abstract  org.apache.tapestry.contrib.table.model.ITableColumn getColumn()
          The object representing the current column being rendered.
 java.util.List<org.apache.tapestry.contrib.table.model.ITableColumn> getColumns()
           
abstract  java.util.List<org.apache.tapestry.contrib.table.model.ITableColumn> getColumnsCache()
           
abstract  java.lang.String getColumnsClass()
          The CSS class of the table columns.
abstract  org.apache.tapestry.services.ExpressionEvaluator getEvaluator()
           
abstract  java.lang.Object getExtraColumns()
          This parameter provides a new set of columns to be displayed after the ones provided by the IClassDescriptor or EditProperties parameters.
protected  IPropertyDescriptor getFirstDisplayableProperty()
          Returns the first displayable property.
 java.lang.String getIdentifierProperty()
           
protected  IPropertyDescriptor getIdentifierPropertyDescriptor()
           
abstract  int getIndex()
          If provided, the parameter is updated with the index of the loop on each iteration.
abstract  java.lang.String getInitialSortColumn()
          The id of the column to initially sort the table by.
abstract  boolean getInitialSortOrder()
          The order of the initial sorting.
abstract  java.util.List getInstances()
          The data to be displayed by the component.
 java.lang.String getLinkProperty()
          Returns the name of the property to be used as link to the editor.
abstract  java.lang.Object getObject()
          If provided, the parameter is updated with the current row being rendered.
abstract  java.lang.Object getObjectParameter()
          Returns the currently rendered table row.
abstract  int getPageSize()
          The number of records displayed per page.
abstract  java.lang.String getPersist()
          Defines how the table state (paging and sorting) will be persisted if no tableSessionStoreManager is defined.
abstract  PersistenceService getPersistenceService()
           
abstract  java.lang.String getRowsClass()
          The CSS class of the table rows.
 java.lang.Object getSource()
          It provides the source parameter to the inner [table ]
protected  org.apache.tapestry.contrib.table.model.ITableColumnModel getTableColumnModel()
          Returns the table column model as specified by the 'columns' binding.
protected  org.apache.tapestry.contrib.table.components.TableView getTableViewComponent()
           
abstract  boolean isCacheDisabled()
           
abstract  boolean isShowCollections()
           
 void pageBeginRender(org.apache.tapestry.event.PageEvent event)
           
protected  void prepareForRender(org.apache.tapestry.IRequestCycle cycle)
           
abstract  void setColumnsCache(java.util.List<org.apache.tapestry.contrib.table.model.ITableColumn> columns)
           
abstract  void setExtraColumns(java.lang.Object o)
           
abstract  void setInstances(java.util.List instances)
           
abstract  void setObjectParameter(java.lang.Object object)
           
abstract  void setShowCollections(boolean ShowCollections)
           
protected  boolean shouldDisplay(IPropertyDescriptor descriptor)
          Hook method to allow subclasses to modify when an IPropertyDescriptor should be displayed.
 
Methods inherited from class org.trails.component.ClassDescriptorComponent
getBlock, getClassDescriptor, getPropertyDescriptors, getPropertyNames, hasBlock
 
Methods inherited from class org.trails.component.TrailsComponent
getMessage, getResourceBundleMessageSource
 
Methods inherited from class org.apache.tapestry.BaseComponent
addOuter, finishLoad, getContainedRenderers, getInnerRenderers, renderComponent
 
Methods inherited from class org.apache.tapestry.AbstractComponent
addAsset, addBody, addComponent, checkActiveLock, cleanupAfterRender, enterActiveState, equals, finishLoad, generateClientId, getAsset, getAssets, getBeans, getBinding, getBindingNames, getBindings, getBody, getBodyCount, getBoundId, getClientId, getComponent, getComponents, getContainedComponent, getContainer, getEventInvoker, getExtendedId, getId, getIdPath, getListeners, getMessages, getNamespace, getPage, getRenderWorker, getSpecification, getSpecifiedId, getTemplateTagName, hasEvents, hashCode, isInActiveState, isParameterBound, isRendering, isStateful, pageEndRender, peekClientId, render, renderBody, renderIdAttribute, renderInformalParameters, setBinding, setClientId, setContainedComponent, setContainer, setHasEvents, setId, setNamespace, setPage, setTemplateTagName, toString, triggerEvent
 
Methods inherited from class org.apache.hivemind.impl.BaseLocatable
getLocation, setLocation
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface org.apache.tapestry.IComponent
addAsset, addBody, addComponent, enterActiveState, getAsset, getAssets, getBeans, getBinding, getBindingNames, getBindings, getClientId, getComponent, getComponents, getContainedComponent, getContainer, getEventInvoker, getExtendedId, getId, getIdPath, getListeners, getMessages, getNamespace, getPage, getSpecification, getSpecifiedId, getTemplateTagName, isRendering, peekClientId, renderBody, setBinding, setClientId, setContainedComponent, setContainer, setId, setNamespace, setPage, setTemplateTagName
 
Methods inherited from interface org.apache.tapestry.IRender
render
 
Methods inherited from interface org.apache.hivemind.LocationHolder
setLocation
 
Methods inherited from interface org.apache.hivemind.Locatable
getLocation
 

Field Detail

LINK_COLUMN

public static final java.lang.String LINK_COLUMN
See Also:
Constant Field Values

columns

protected java.util.List<org.apache.tapestry.contrib.table.model.ITableColumn> columns
Constructor Detail

ObjectTable

public ObjectTable()
Method Detail

isCacheDisabled

@Parameter(defaultValue="ognl:@java.lang.System@getProperty(\'org.apache.tapestry.disable-caching\')")
public abstract boolean isCacheDisabled()

isShowCollections

@Parameter(required=false,
           defaultValue="false",
           cache=true)
public abstract boolean isShowCollections()

setShowCollections

public abstract void setShowCollections(boolean ShowCollections)

getPersistenceService

@InjectObject(value="service:trails.core.PersistenceService")
public abstract PersistenceService getPersistenceService()

getInstances

@Parameter
public abstract java.util.List getInstances()
The data to be displayed by the component.

Returns:

setInstances

public abstract void setInstances(java.util.List instances)

getObject

@Parameter(cache=false,
           defaultValue="objectParameter")
public abstract java.lang.Object getObject()
If provided, the parameter is updated with the current row being rendered.


getObjectParameter

public abstract java.lang.Object getObjectParameter()
Returns the currently rendered table row. It's used when there is no binding for the "object" parameter. This method is for internal use only.


setObjectParameter

public abstract void setObjectParameter(java.lang.Object object)

getColumn

@Parameter(cache=false)
public abstract org.apache.tapestry.contrib.table.model.ITableColumn getColumn()
The object representing the current column being rendered.


getRowsClass

@Parameter(cache=false)
public abstract java.lang.String getRowsClass()
The CSS class of the table rows.


getColumnsClass

@Parameter(cache=false)
public abstract java.lang.String getColumnsClass()
The CSS class of the table columns.


getPageSize

@Parameter(cache=false,
           defaultValue="10")
public abstract int getPageSize()
The number of records displayed per page.


getIndex

@Parameter
public abstract int getIndex()
If provided, the parameter is updated with the index of the loop on each iteration.


getInitialSortColumn

@Parameter
public abstract java.lang.String getInitialSortColumn()
The id of the column to initially sort the table by.


getInitialSortOrder

@Parameter(defaultValue="false")
public abstract boolean getInitialSortOrder()
The order of the initial sorting. Set this parameter to 'false' to sort in an ascending order and to 'true' to sort in a descending one.


getPersist

@Parameter(defaultValue="literal:session")
public abstract java.lang.String getPersist()
Defines how the table state (paging and sorting) will be persisted if no tableSessionStoreManager is defined. The possible values are 'session' (the default), 'client', 'client:page', and 'client:app'.


getArrowDownAsset

@Parameter
public abstract org.apache.tapestry.IAsset getArrowDownAsset()
The image to use to describe a column sorted in a descending order.


getArrowUpAsset

@Parameter
public abstract org.apache.tapestry.IAsset getArrowUpAsset()
The image to use to describe a column sorted in an ascending order.


getColumns

public java.util.List<org.apache.tapestry.contrib.table.model.ITableColumn> getColumns()
Returns:
The table columns to be displayed.

getColumnsCache

@Persist
public abstract java.util.List<org.apache.tapestry.contrib.table.model.ITableColumn> getColumnsCache()

setColumnsCache

public abstract void setColumnsCache(java.util.List<org.apache.tapestry.contrib.table.model.ITableColumn> columns)

getExtraColumns

@Parameter
public abstract java.lang.Object getExtraColumns()
This parameter provides a new set of columns to be displayed after the ones provided by the IClassDescriptor or EditProperties parameters. The parameter works like the [contrib table] 'columns' parameter. The parameter must be an array, a list, or an Iterator of ITableColumn objects, an ITableColumnModel, or a String describing the columns (see documentation).


setExtraColumns

public abstract void setExtraColumns(java.lang.Object o)

getEvaluator

@InjectObject(value="service:tapestry.ognl.ExpressionEvaluator")
public abstract org.apache.tapestry.services.ExpressionEvaluator getEvaluator()

prepareForRender

protected void prepareForRender(org.apache.tapestry.IRequestCycle cycle)
Overrides:
prepareForRender in class org.apache.tapestry.AbstractComponent

pageBeginRender

public void pageBeginRender(org.apache.tapestry.event.PageEvent event)
Specified by:
pageBeginRender in interface org.apache.tapestry.event.PageBeginRenderListener

alterTableColumn

protected void alterTableColumn(IPropertyDescriptor descriptor,
                                TrailsTableColumn tableColumn)
Hook method to allow subclasses to modify the tableColumn,

Parameters:
descriptor -
tableColumn -

shouldDisplay

protected boolean shouldDisplay(IPropertyDescriptor descriptor)
Description copied from class: ClassDescriptorComponent
Hook method to allow subclasses to modify when an IPropertyDescriptor should be displayed.

Overrides:
shouldDisplay in class ClassDescriptorComponent
Returns:

getIdentifierProperty

public java.lang.String getIdentifierProperty()
Returns:

getLinkProperty

public java.lang.String getLinkProperty()
Returns the name of the property to be used as link to the editor. If the default Id property is not displayable then return the name of the first displayable property.

Returns:

getFirstDisplayableProperty

protected IPropertyDescriptor getFirstDisplayableProperty()
Returns the first displayable property.

Returns:

getIdentifierPropertyDescriptor

protected IPropertyDescriptor getIdentifierPropertyDescriptor()
Returns:

getSource

public java.lang.Object getSource()
It provides the source parameter to the inner [table ]

Returns:
The data to be displayed by the inner table.

getTableColumnModel

protected org.apache.tapestry.contrib.table.model.ITableColumnModel getTableColumnModel()
Returns the table column model as specified by the 'columns' binding. If the value of the 'columns' binding is of a type different than ITableColumnModel, this method makes the appropriate conversion.

Returns:
The table column model as specified by the 'columns' binding

generateTableColumnModel

protected org.apache.tapestry.contrib.table.model.ITableColumnModel generateTableColumnModel(java.lang.String strDesc)
Generate a table column model out of the description string provided. Entries in the description string are separated by commas. Each column entry is of the format name, name:expression, or name:displayName:expression. An entry prefixed with ! represents a non-sortable column. If the whole description string is prefixed with *, it represents columns to be included in a Form.

Parameters:
strDesc - the description of the column model to be generated
Returns:
a table column model based on the provided description

getTableViewComponent

protected org.apache.tapestry.contrib.table.components.TableView getTableViewComponent()


Copyright © 2004-2008. All Rights Reserved.