M
- grid model object typeI
- row/item model object typepublic interface IGridColumn<M,I,S>
extends org.apache.wicket.model.IDetachable
Modifier and Type | Method and Description |
---|---|
boolean |
cellClicked(org.apache.wicket.model.IModel<I> rowModel)
Allows to override default behavior when a row is clicked.
|
String |
getCellCssClass(org.apache.wicket.model.IModel<I> rowModel,
int rowNum)
Returns the cell specified by rowModel.
|
int |
getColSpan(org.apache.wicket.model.IModel<I> rowModel)
Returns the spanning value for cell specified by rowModel.
|
String |
getHeaderCssClass()
Returns the CSS class for this column header.
|
String |
getId()
Returns the column id.
|
int |
getInitialSize()
Returns the initial size of column.
|
int |
getMaxSize()
Returns the maximal size of resizable column.
|
int |
getMinSize()
Returns the minimal size of resizable column.
|
SizeUnit |
getSizeUnit()
Returns the unit in which sizes are specified.
|
S |
getSortProperty()
Result of this method determines whether the column is sortable and in case it is, also
determines the sort property.
|
boolean |
getWrapText()
Determines the behavior when there is more text in cell than it fits in it.
|
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. |
boolean |
isReorderable()
Returns whether user will be allowed to reorder this column (i.e.
|
boolean |
isResizable()
Returns whether user will be able to resize this column.
|
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.
|
org.apache.wicket.Component |
newHeader(String componentId)
Creates a new component for column header.
|
void |
setGrid(AbstractGrid<M,I,S> grid)
Invoked before the first render of the grid.
|
String getId()
org.apache.wicket.Component newHeader(String componentId)
componentId
- required id that the component must haveboolean 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 footprintrowModel
- model for given rowtrue
if the cell is lightweight, false
otherwiseorg.apache.wicket.Component newCell(org.apache.wicket.markup.html.WebMarkupContainer parent, String componentId, org.apache.wicket.model.IModel<I> rowModel)
isLightWeight(IModel)
returns false ).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 rowIRenderable<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 (
isLightWeight(IModel)
returns true
).rowModel
- model for given rowIRenderable
instanceS getSortProperty()
IGridSortState
.null
if the column is not sortableIGridSortState.ISortStateColumn.getPropertyName()
boolean isResizable()
getSizeUnit()
must return SizeUnit.PX
, otherwise an
IllegalStateException
will be thrown.true
if the column is resizable, false
otherwise.int getInitialSize()
getSizeUnit()
.SizeUnit getSizeUnit()
SizeUnit.PX
.int getMinSize()
int getMaxSize()
boolean isReorderable()
true
if the column is reorderable, false
otherwiseString getHeaderCssClass()
null
String getCellCssClass(org.apache.wicket.model.IModel<I> rowModel, int rowNum)
int getColSpan(org.apache.wicket.model.IModel<I> rowModel)
rowModel
- model for given rowvoid setGrid(AbstractGrid<M,I,S> grid)
grid
- grid that contains this columnboolean getWrapText()
true
, the text will be wrapped and row height increased. If the method
returns false
, the remaining part of text will be hidden.boolean cellClicked(org.apache.wicket.model.IModel<I> rowModel)
true
the default
behavior will be suppressed.rowModel
- Model for clicked rowtrue
if the default behavior when row is clicked should be supressed,
false
otherwise.Copyright © 2015. All rights reserved.