Package com.inmethod.grid.column
Class LinkColumn<M,I,S>
- java.lang.Object
-
- com.inmethod.grid.column.AbstractColumn<M,I,S>
-
- com.inmethod.grid.column.LinkColumn<M,I,S>
-
- All Implemented Interfaces:
IGridColumn<M,I,S>
,Serializable
,IDetachable
,IClusterable
- Direct Known Subclasses:
PageLinkColumn
public abstract class LinkColumn<M,I,S> extends AbstractColumn<M,I,S>
Abstract column to display links in aDataGrid
- Author:
- Tom Burton
- See Also:
- Serialized Form
-
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description String
getPropertyLabel()
Component
newCell(WebMarkupContainer parent, String componentId, IModel<I> rowModel)
Creates a new cell component.IRenderable<I>
newCell(IModel<I> rowModel)
Creates a newIRenderable
instance that is used to render to render the output of cell for given row.abstract void
onClick(IModel<I> rowModel)
Called when a link is clicked.void
setPropertyLabel(String propertyLabel)
-
Methods inherited from class com.inmethod.grid.column.AbstractColumn
cellClicked, detach, getCellCssClass, getColSpan, getGrid, getHeaderCssClass, getHeaderModel, getHeaderTooltipModel, getId, getInitialSize, getMaxSize, getMinSize, getSizeUnit, getSortProperty, getWrapText, isLightWeight, isReorderable, isResizable, newHeader, setGrid, setHeaderTooltipModel, setInitialSize, setMaxSize, setMinSize, setReorderable, setResizable, setSizeUnit, setWrapText
-
-
-
-
Constructor Detail
-
LinkColumn
public LinkColumn(String columnId, String propertyLabel, IModel<String> headerModel)
Create a new Link Column- Parameters:
columnId
- column id (must be unique within the grid)propertyLabel
- Label to display for the Link, gotten from the model object itself alaPropertyModel
headerModel
- model object for the column header
-
LinkColumn
public LinkColumn(String columnId, String propertyLabel, IModel<String> headerModel, S sortProperty)
Create a new Link Column- Parameters:
columnId
- column id (must be unique within the grid)propertyLabel
- Label to display for the Link, gotten from the model object itself alaPropertyModel
headerModel
- model object for the column headersortProperty
- property to sort the column by
-
-
Method Detail
-
newCell
public IRenderable<I> newCell(IModel<I> rowModel)
Description copied from class:AbstractColumn
Creates a newIRenderable
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)
returnstrue
).- Specified by:
newCell
in interfaceIGridColumn<M,I,S>
- Overrides:
newCell
in classAbstractColumn<M,I,S>
- Parameters:
rowModel
- model for given row- Returns:
IRenderable
instance
-
newCell
public Component newCell(WebMarkupContainer parent, String componentId, IModel<I> rowModel)
Description copied from class:AbstractColumn
Creates a new cell component. This method is called for rows that are not lightweight (IGridColumn.isLightWeight(IModel)
returns false ).- Specified by:
newCell
in interfaceIGridColumn<M,I,S>
- Specified by:
newCell
in classAbstractColumn<M,I,S>
- Parameters:
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 row- Returns:
- new cell component
-
getPropertyLabel
public String getPropertyLabel()
- Returns:
- row model object property name for the link Text
-
setPropertyLabel
public void setPropertyLabel(String propertyLabel)
- Parameters:
propertyLabel
- row model object property name for the link Text
-
onClick
public abstract void onClick(IModel<I> rowModel)
Called when a link is clicked.- Parameters:
rowModel
- Model Object for the DataGridRow being passed to the link- See Also:
Link.onClick()
-
-