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 StringgetPropertyLabel()ComponentnewCell(WebMarkupContainer parent, String componentId, IModel<I> rowModel)Creates a new cell component.IRenderable<I>newCell(IModel<I> rowModel)Creates a newIRenderableinstance that is used to render to render the output of cell for given row.abstract voidonClick(IModel<I> rowModel)Called when a link is clicked.voidsetPropertyLabel(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 alaPropertyModelheaderModel- 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 alaPropertyModelheaderModel- 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:AbstractColumnCreates a newIRenderableinstance 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:
newCellin interfaceIGridColumn<M,I,S>- Overrides:
newCellin classAbstractColumn<M,I,S>- Parameters:
rowModel- model for given row- Returns:
IRenderableinstance
-
newCell
public Component newCell(WebMarkupContainer parent, String componentId, IModel<I> rowModel)
Description copied from class:AbstractColumnCreates a new cell component. This method is called for rows that are not lightweight (IGridColumn.isLightWeight(IModel)returns false ).- Specified by:
newCellin interfaceIGridColumn<M,I,S>- Specified by:
newCellin 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()
-
-