M
- grid model object typeI
- row/item model object typepublic abstract class AbstractLightWeightColumn<M,I,S> extends AbstractColumn<M,I,S>
IGridColumn
. This class should be used as base for
lightweight columns.
Contains getters and setters for most properties and takes care of the header component. The only
method necessary to implement is newCell(IModel)
.
EditablePropertyColumn
,
Serialized FormConstructor and Description |
---|
AbstractLightWeightColumn(String columnId,
org.apache.wicket.model.IModel<String> headerModel)
Creates instance with specified column id and header model
|
AbstractLightWeightColumn(String columnId,
org.apache.wicket.model.IModel<String> headerModel,
S sortProperty)
Creates instance with specified column id, header model and sort property.
|
Modifier and Type | Method and Description |
---|---|
boolean |
isLightWeight(org.apache.wicket.model.IModel<I> rowModel)
Returns whether this column is uses a component for cell in given row (not lightweight) or an
IRenderable implementation. |
abstract IRenderable<I> |
newCell(org.apache.wicket.model.IModel<I> rowModel)
Creates a new
IRenderable instance that is used to render to render the output of
cell for given row. |
org.apache.wicket.Component |
newCell(org.apache.wicket.markup.html.WebMarkupContainer parent,
String componentId,
org.apache.wicket.model.IModel<I> rowModel)
Creates a new cell component.
|
cellClicked, detach, getCellCssClass, getColSpan, getGrid, getHeaderCssClass, getHeaderModel, getHeaderTooltipModel, getId, getInitialSize, getMaxSize, getMinSize, getSizeUnit, getSortProperty, getWrapText, isReorderable, isResizable, newHeader, setGrid, setHeaderTooltipModel, setInitialSize, setMaxSize, setMinSize, setReorderable, setResizable, setSizeUnit, setWrapText
public AbstractLightWeightColumn(String columnId, org.apache.wicket.model.IModel<String> headerModel, S sortProperty)
columnId
- column identifier - must be unique within the gridheaderModel
- model for column titlesortProperty
- optional string that will be returned by ISortState
to indicate that the
column is being sortedpublic boolean isLightWeight(org.apache.wicket.model.IModel<I> rowModel)
IRenderable
implementation. Generally, if the cell is non-interactive (label only),
it's better to use an IRenderable
implementation, as it has zero memory footprintisLightWeight
in interface IGridColumn<M,I,S>
isLightWeight
in class AbstractColumn<M,I,S>
rowModel
- model for given rowtrue
if the cell is lightweight, false
otherwisepublic abstract IRenderable<I> newCell(org.apache.wicket.model.IModel<I> rowModel)
IRenderable
instance that is used to render to render the output of
cell for given row. This method is called for rows that are lightweight (
IGridColumn.isLightWeight(IModel)
returns true
).newCell
in interface IGridColumn<M,I,S>
newCell
in class AbstractColumn<M,I,S>
rowModel
- model for given rowIRenderable
instancepublic org.apache.wicket.Component newCell(org.apache.wicket.markup.html.WebMarkupContainer parent, String componentId, org.apache.wicket.model.IModel<I> rowModel)
IGridColumn.isLightWeight(IModel)
returns false ).newCell
in interface IGridColumn<M,I,S>
newCell
in class AbstractColumn<M,I,S>
parent
- Parent component. This is passed in only for convenience, the method
implementation is not supposed to add the newly created component to the
parent.componentId
- required id of newly created componentsrowModel
- model for given rowCopyright © 2015. All rights reserved.