com.inmethod.grid.column.tree
Class AbstractTreeColumn<T extends TreeModel & Serializable,I extends TreeNode & Serializable>

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

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

Base class for TreeGrid column that contains the actual tree.

Author:
Matej Knopp
See Also:
Serialized Form

Constructor Summary
AbstractTreeColumn(String columnId, IModel<String> headerModel)
          Creates instance with specified column id and header model
AbstractTreeColumn(String columnId, IModel<String> headerModel, String sortProperty)
          Creates instance with specified column id, header model and sort property.
 
Method Summary
protected  Icon getIcon(IModel<I> model)
          Returns the icon for given TreeNode.
 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.
protected abstract  Component newNodeComponent(String id, IModel<I> model)
          Creates the node component.
 
Methods inherited from class com.inmethod.grid.treegrid.BaseTreeColumn
getTreeGrid, setGrid
 
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, 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

AbstractTreeColumn

public AbstractTreeColumn(String columnId,
                          IModel<String> headerModel,
                          String sortProperty)
Creates instance with specified column id, header model and sort property.

Parameters:
columnId - column identifier - must be unique within the grid
headerModel - model for column title
sortProperty - optional string that will be returned by ISortState to indicate that the column is being sorted

AbstractTreeColumn

public AbstractTreeColumn(String columnId,
                          IModel<String> headerModel)
Creates instance with specified column id and header model

Parameters:
columnId - column identifier - must be unique within the grid
headerModel - model for column title
Method Detail

getIcon

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

Specified by:
getIcon in class BaseTreeColumn<T extends TreeModel & Serializable,I extends TreeNode & Serializable>
Parameters:
model - model used to access the TreeNode
Returns:
icon instance or null if no icon should be displayed

newNodeComponent

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

Specified by:
newNodeComponent in class BaseTreeColumn<T extends TreeModel & Serializable,I extends TreeNode & Serializable>
Parameters:
id - component id
model - model used to access the TreeNode
Returns:
newly created component instance

newCell

public final 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>
Overrides:
newCell in class BaseTreeColumn<T extends TreeModel & Serializable,I extends TreeNode & Serializable>
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

newCell

public final 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. This method is called for rows that are lightweight ( IGridColumn.isLightWeight(IModel) returns true ).

Specified by:
newCell in interface IGridColumn<T extends TreeModel & Serializable,I extends TreeNode & Serializable>
Overrides:
newCell in class AbstractColumn<T extends TreeModel & Serializable,I extends TreeNode & Serializable>
Parameters:
rowModel - model for given row
Returns:
IRenderable instance


Copyright © 2007-2012 inMethod s.r.o.. All Rights Reserved.