org.apache.wicket.extensions.markup.html.repeater.data.table
Class AbstractColumn<T>

java.lang.Object
  extended by org.apache.wicket.extensions.markup.html.repeater.data.table.AbstractColumn<T>
Type Parameters:
T -
All Implemented Interfaces:
java.io.Serializable, ICellPopulator<T>, IColumn<T>, IStyledColumn<T>, IClusterable, IDetachable
Direct Known Subclasses:
FilteredAbstractColumn, HeaderlessColumn, PropertyColumn

public abstract class AbstractColumn<T>
extends java.lang.Object
implements IStyledColumn<T>

A helper implementation for the IColumn interface

Author:
Igor Vaynberg ( ivaynberg )
See Also:
Serialized Form

Constructor Summary
AbstractColumn(IModel<java.lang.String> displayModel)
           
AbstractColumn(IModel<java.lang.String> displayModel, java.lang.String sortProperty)
           
 
Method Summary
 void detach()
          Detaches model after use.
 java.lang.String getCssClass()
          Returns the css class for this column.
 IModel<java.lang.String> getDisplayModel()
           
 Component getHeader(java.lang.String componentId)
          Returns the component that will be used as the header for the column.
 java.lang.String getSortProperty()
          Returns the name of the property that this header sorts.
 boolean isSortable()
          Returns true if this header should be a sortable header
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface org.apache.wicket.extensions.markup.html.repeater.data.grid.ICellPopulator
populateItem
 

Constructor Detail

AbstractColumn

public AbstractColumn(IModel<java.lang.String> displayModel,
                      java.lang.String sortProperty)
Parameters:
displayModel - model used to generate header text
sortProperty - sort property this column represents

AbstractColumn

public AbstractColumn(IModel<java.lang.String> displayModel)
Parameters:
displayModel - model used to generate header text
Method Detail

getDisplayModel

public IModel<java.lang.String> getDisplayModel()
Returns:
returns display model to be used for the header component

getSortProperty

public java.lang.String getSortProperty()
Description copied from interface: IColumn
Returns the name of the property that this header sorts. If null is returned the header will be unsortable.

Specified by:
getSortProperty in interface IColumn<T>
Returns:
a string representing the sort property
See Also:
IColumn.getSortProperty()

isSortable

public boolean isSortable()
Description copied from interface: IColumn
Returns true if this header should be a sortable header

Specified by:
isSortable in interface IColumn<T>
Returns:
true if header should be sortable
See Also:
IColumn.isSortable()

getHeader

public Component getHeader(java.lang.String componentId)
Description copied from interface: IColumn
Returns the component that will be used as the header for the column. This component will be contained in <span> tags.

Specified by:
getHeader in interface IColumn<T>
Parameters:
componentId - component id for the returned Component
Returns:
component that will be used as the header for the column
See Also:
IColumn.getHeader(java.lang.String)

detach

public void detach()
Description copied from interface: IDetachable
Detaches model after use. This is generally used to null out transient references that can be re-attached later.

Specified by:
detach in interface IDetachable
See Also:
IDetachable.detach()

getCssClass

public java.lang.String getCssClass()
Description copied from interface: IStyledColumn
Returns the css class for this column.

Specified by:
getCssClass in interface IStyledColumn<T>
Returns:
CSS class name


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