com.inmethod.grid.column
Class LinkColumn<M,I,S>

java.lang.Object
  extended by com.inmethod.grid.column.AbstractColumn<M,I,S>
      extended by 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 a DataGrid

Author:
Tom Burton
See Also:
Serialized Form

Constructor Summary
LinkColumn(String columnId, String propertyLabel, IModel<String> headerModel)
          Create a new Link Column
LinkColumn(String columnId, String propertyLabel, IModel<String> headerModel, S sortProperty)
          Create a new Link Column
 
Method Summary
 String getPropertyLabel()
           
 IRenderable<I> newCell(IModel<I> rowModel)
          Creates a new IRenderable instance that is used to render to render the output of cell for given row.
 Component newCell(WebMarkupContainer parent, String componentId, IModel<I> rowModel)
          Creates a new cell component.
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
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

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 ala PropertyModel
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 ala PropertyModel
headerModel - model object for the column header
sortProperty - property to sort the column by
Method Detail

newCell

public IRenderable<I> newCell(IModel<I> rowModel)
Description copied from class: AbstractColumn
Creates a new 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 ).

Specified by:
newCell in interface IGridColumn<M,I,S>
Overrides:
newCell in class AbstractColumn<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 interface IGridColumn<M,I,S>
Specified by:
newCell in class AbstractColumn<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 components
rowModel - 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()


Copyright © 2007–2014 inMethod s.r.o.. All rights reserved.