Package com.inmethod.grid.treegrid
Class BaseTreeColumn<T extends TreeModel & Serializable,I extends TreeNode & Serializable,S>
- java.lang.Object
-
- com.inmethod.grid.column.AbstractColumn<T,I,S>
-
- com.inmethod.grid.treegrid.BaseTreeColumn<T,I,S>
-
- Type Parameters:
T- tree model object typeI- 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>
INTERNALBase class for column containing the actual tree in
TreeGrid. Users should not subclass this class directly. Rather than that theAbstractTreeColumnclass should be used.- Author:
- Matej Knopp
- See Also:
- Serialized Form
-
-
Constructor Summary
Constructors Constructor Description BaseTreeColumn(String columnId, IModel<String> headerModel)Constructor.BaseTreeColumn(String columnId, IModel<String> headerModel, S sortProperty)Constructor.
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description protected abstract IcongetIcon(IModel<I> model)Returns the icon for givenTreeNode.TreeGrid<T,I,S>getTreeGrid()Returns theTreeGridthis column belongs to.ComponentnewCell(WebMarkupContainer parent, String componentId, IModel<I> rowModel)Creates a new cell component.protected abstract ComponentnewNodeComponent(String id, IModel<I> model)Creates the node component.voidsetGrid(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
-
-
-
-
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:
newCellin interfaceIGridColumn<T extends TreeModel & Serializable,I extends TreeNode & Serializable,S>- Specified by:
newCellin classAbstractColumn<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 componentsrowModel- 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 idmodel- model used to access theTreeNode- Returns:
- newly created component instance
-
getIcon
protected abstract Icon getIcon(IModel<I> model)
Returns the icon for givenTreeNode.- Parameters:
model- model used to access theTreeNode- Returns:
- icon instance or
nullif no icon should be displayed
-
getTreeGrid
public TreeGrid<T,I,S> getTreeGrid()
Returns theTreeGridthis column belongs to.- Returns:
TreeGridthis 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:
setGridin interfaceIGridColumn<T extends TreeModel & Serializable,I extends TreeNode & Serializable,S>- Overrides:
setGridin classAbstractColumn<T extends TreeModel & Serializable,I extends TreeNode & Serializable,S>- Parameters:
grid- grid that contains this column
-
-