org.apache.wicket.extensions.markup.html.repeater.data.table.export
Class AbstractExportableColumn<T,S,D>

java.lang.Object
  extended by org.apache.wicket.extensions.markup.html.repeater.data.table.AbstractColumn<T,S>
      extended by org.apache.wicket.extensions.markup.html.repeater.data.table.export.AbstractExportableColumn<T,S,D>
Type Parameters:
T - The type of each row in the table.
S - The type of the sort property of the table.
D - The type of the data displayed in this column.
All Implemented Interfaces:
Serializable, ICellPopulator<T>, IExportableColumn<T,S,D>, IColumn<T,S>, IStyledColumn<T,S>, IDetachable, org.apache.wicket.util.io.IClusterable

public abstract class AbstractExportableColumn<T,S,D>
extends AbstractColumn<T,S>
implements IExportableColumn<T,S,D>

A helper implementation of IExportableColumn. This implementation requires you to only implement IExportableColumn.getDataModel(org.apache.wicket.model.IModel).

Author:
Jesse Long
See Also:
Serialized Form

Constructor Summary
AbstractExportableColumn(IModel<String> displayModel)
          Creates a new AbstractExportableColumn with the provided display model, and without a sort property.
AbstractExportableColumn(IModel<String> displayModel, S sortProperty)
          Creates a new AbstractExportableColumn with the provided display model, and sort property.
 
Method Summary
protected  Component createDisplayComponent(String componentId, IModel<D> dataModel)
          Creates a Component which will be used to display the content of the column in this row.
 void populateItem(Item<ICellPopulator<T>> cellItem, String componentId, IModel<T> rowModel)
          Populated the data for this column in the row into the cellItem.
 
Methods inherited from class org.apache.wicket.extensions.markup.html.repeater.data.table.AbstractColumn
detach, getCssClass, getDisplayModel, getHeader, getSortProperty, isSortable
 
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.table.export.IExportableColumn
getDataModel, getDisplayModel
 
Methods inherited from interface org.apache.wicket.extensions.markup.html.repeater.data.table.IColumn
getHeader, getSortProperty, isSortable
 
Methods inherited from interface org.apache.wicket.model.IDetachable
detach
 

Constructor Detail

AbstractExportableColumn

public AbstractExportableColumn(IModel<String> displayModel)
Creates a new AbstractExportableColumn with the provided display model, and without a sort property.

Parameters:
displayModel - The IModel of the text to be used in the column header.

AbstractExportableColumn

public AbstractExportableColumn(IModel<String> displayModel,
                                S sortProperty)
Creates a new AbstractExportableColumn with the provided display model, and sort property.

Parameters:
displayModel - The IModel of the text to be used in the column header.
sortProperty - The sort property used by this column.
Method Detail

createDisplayComponent

protected Component createDisplayComponent(String componentId,
                                           IModel<D> dataModel)
Creates a Component which will be used to display the content of the column in this row. The default implementation simply creates a label with the data model provided.

Parameters:
componentId - The component id of the display component.
dataModel - The model of the data for this column in the row. This should usually be passed as the model of the display component.
Returns:
a Component which will be used to display the content of the column in this row.

populateItem

public void populateItem(Item<ICellPopulator<T>> cellItem,
                         String componentId,
                         IModel<T> rowModel)
Populated the data for this column in the row into the cellItem.

This implementation adds the Component returned by createDisplayComponent(java.lang.String, org.apache.wicket.model.IModel) to the cell.

Specified by:
populateItem in interface ICellPopulator<T>
Parameters:
cellItem - The cell to be populated.
componentId - The component id to be used for the component that will be added to the cell.
rowModel - A model of the row data.
See Also:
Item


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