M
- grid model object typeI
- row/item model object typepublic class WicketColumnAdapter<M,I,S> extends AbstractColumn<M,I,S>
DataTable
columns from wicket extensions in an
AbstractGrid
.
Note that due to different internal structure of AbstractGrid
and DataTable
this
adapter might not work for every IColumn
implementation. Basically if the implementation
relies on the parent instance given in ICellPopulator.populateItem(Item, String, IModel)
it will probably not work properly with this adapter, as the parent instance this adapter uses is
only temporary.
Constructor and Description |
---|
WicketColumnAdapter(String columnId,
org.apache.wicket.extensions.markup.html.repeater.data.table.IColumn<I,S> column)
Constructor
|
Modifier and Type | Method and Description |
---|---|
String |
getCellCssClass(org.apache.wicket.model.IModel<I> rowModel,
int rowNum)
Returns the cell specified by rowModel.
|
S |
getSortProperty()
Result of this method determines whether the column is sortable and in case it is, also
determines the sort property.
|
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.
|
org.apache.wicket.Component |
newHeader(String componentId)
Creates a new component for column header.
|
static <T,M,I,S> List<IGridColumn<M,I,S>> |
wrapColumns(org.apache.wicket.extensions.markup.html.repeater.data.table.IColumn<I,S>[] columns)
Returns the specified
IColumn array as list of WicketColumnAdapter s that can
be given to an AbstractGrid . |
static <M,I,S> List<IGridColumn<M,I,S>> |
wrapColumns(List<org.apache.wicket.extensions.markup.html.repeater.data.table.IColumn<I,S>> columns)
Returns the specified
IColumn list as list of WicketColumnAdapter s that can
be given to an AbstractGrid . |
cellClicked, detach, getColSpan, getGrid, getHeaderCssClass, getHeaderModel, getHeaderTooltipModel, getId, getInitialSize, getMaxSize, getMinSize, getSizeUnit, getWrapText, isLightWeight, isReorderable, isResizable, newCell, setGrid, setHeaderTooltipModel, setInitialSize, setMaxSize, setMinSize, setReorderable, setResizable, setSizeUnit, setWrapText
public 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 rowpublic org.apache.wicket.Component newHeader(String componentId)
newHeader
in interface IGridColumn<M,I,S>
newHeader
in class AbstractColumn<M,I,S>
componentId
- required id that the component must havepublic String getCellCssClass(org.apache.wicket.model.IModel<I> rowModel, int rowNum)
getCellCssClass
in interface IGridColumn<M,I,S>
getCellCssClass
in class AbstractColumn<M,I,S>
rowModel
- model for given rowrowNum
- index of row for DataGrid
, -1 for TreeGrid
null
public S getSortProperty()
IGridSortState
.getSortProperty
in interface IGridColumn<M,I,S>
getSortProperty
in class AbstractColumn<M,I,S>
null
if the column is not sortableIGridSortState.ISortStateColumn.getPropertyName()
public static <T,M,I,S> List<IGridColumn<M,I,S>> wrapColumns(org.apache.wicket.extensions.markup.html.repeater.data.table.IColumn<I,S>[] columns)
IColumn
array as list of WicketColumnAdapter
s that can
be given to an AbstractGrid
. The column identifiers are generated.columns
- array of IColumn
sIGridColumn
spublic static <M,I,S> List<IGridColumn<M,I,S>> wrapColumns(List<org.apache.wicket.extensions.markup.html.repeater.data.table.IColumn<I,S>> columns)
IColumn
list as list of WicketColumnAdapter
s that can
be given to an AbstractGrid
. The column identifiers are generated.columns
- list of IColumn
sIGridColumn
sCopyright © 2015. All rights reserved.