com.inmethod.grid.treegrid
Class BaseTreeColumn<T extends TreeModel & Serializable,I extends TreeNode & Serializable,S>

java.lang.Object
  extended by com.inmethod.grid.column.AbstractColumn<T,I,S>
      extended by com.inmethod.grid.treegrid.BaseTreeColumn<T,I,S>
Type Parameters:
T - tree model object type
I - node model object type
All Implemented Interfaces:
IGridColumn<T,I,S>, Serializable, IDetachable, IClusterable
Direct Known Subclasses:
AbstractTreeColumn

public abstract class BaseTreeColumn<T extends TreeModel & Serializable,I extends TreeNode & Serializable,S>
extends AbstractColumn<T,I,S>

INTERNAL

Base class for column containing the actual tree in TreeGrid. Users should not subclass this class directly. Rather than that the AbstractTreeColumn class should be used.

Author:
Matej Knopp
See Also:
Serialized Form

Constructor Summary
BaseTreeColumn(String columnId, IModel<String> headerModel)
          Constructor.
BaseTreeColumn(String columnId, IModel<String> headerModel, S sortProperty)
          Constructor.
 
Method Summary
protected abstract  Icon getIcon(IModel<I> model)
          Returns the icon for given TreeNode.
 TreeGrid<T,I,S> getTreeGrid()
          Returns the TreeGrid this column belongs to.
 Component newCell(WebMarkupContainer parent, String componentId, IModel<I> rowModel)
          Creates a new cell component.
protected abstract  Component newNodeComponent(String id, IModel<I> model)
          Creates the node component.
 void setGrid(AbstractGrid<T,I,S> grid)
          Invoked before the first render of the grid.
 
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, newCell, newHeader, 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

BaseTreeColumn

public BaseTreeColumn(String columnId,
                      IModel<String> headerModel,
                      S sortProperty)
Constructor.

Parameters:
columnId -
headerModel -
sortProperty -

BaseTreeColumn

public BaseTreeColumn(String columnId,
                      IModel<String> headerModel)
Constructor.

Parameters:
columnId -
headerModel -
Method Detail

newCell

public Component newCell(WebMarkupContainer parent,
                         String componentId,
                         IModel<I> rowModel)
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<T extends TreeModel & Serializable,I extends TreeNode & Serializable,S>
Specified by:
newCell in class AbstractColumn<T extends TreeModel & Serializable,I extends TreeNode & Serializable,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

newNodeComponent

protected abstract Component newNodeComponent(String id,
                                              IModel<I> model)
Creates the node component.

Parameters:
id - component id
model - model used to access the TreeNode
Returns:
newly created component instance

getIcon

protected abstract Icon getIcon(IModel<I> model)
Returns the icon for given TreeNode.

Parameters:
model - model used to access the TreeNode
Returns:
icon instance or null if no icon should be displayed

getTreeGrid

public TreeGrid<T,I,S> getTreeGrid()
Returns the TreeGrid this column belongs to.

Returns:
TreeGrid this column belongs to.

setGrid

public void setGrid(AbstractGrid<T,I,S> grid)
Invoked before the first render of the grid. Column that need grid reference can implement this method and store the reference.

Specified by:
setGrid in interface IGridColumn<T extends TreeModel & Serializable,I extends TreeNode & Serializable,S>
Overrides:
setGrid in class AbstractColumn<T extends TreeModel & Serializable,I extends TreeNode & Serializable,S>
Parameters:
grid - grid that contains this column


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