Package com.inmethod.grid.column.tree
Class AbstractTreeColumn<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>
-
- com.inmethod.grid.column.tree.AbstractTreeColumn<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:
PropertyTreeColumn
public abstract class AbstractTreeColumn<T extends TreeModel & Serializable,I extends TreeNode & Serializable,S> extends BaseTreeColumn<T,I,S>
Base class forTreeGridcolumn that contains the actual tree.- Author:
- Matej Knopp
- See Also:
- Serialized Form
-
-
Constructor Summary
Constructors Constructor Description AbstractTreeColumn(String columnId, IModel<String> headerModel)Creates instance with specified column id and header modelAbstractTreeColumn(String columnId, IModel<String> headerModel, S sortProperty)Creates instance with specified column id, header model and sort property.
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description protected IcongetIcon(IModel<I> model)Returns the icon for givenTreeNode.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.protected abstract ComponentnewNodeComponent(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
-
-
-
-
Constructor Detail
-
AbstractTreeColumn
public AbstractTreeColumn(String columnId, IModel<String> headerModel, S sortProperty)
Creates instance with specified column id, header model and sort property.- Parameters:
columnId- column identifier - must be unique within the gridheaderModel- model for column titlesortProperty- optional string that will be returned byISortStateto indicate that the column is being sorted
-
-
Method Detail
-
getIcon
protected Icon getIcon(IModel<I> model)
Returns the icon for givenTreeNode.- Specified by:
getIconin classBaseTreeColumn<T extends TreeModel & Serializable,I extends TreeNode & Serializable,S>- Parameters:
model- model used to access theTreeNode- Returns:
- icon instance or
nullif no icon should be displayed
-
newNodeComponent
protected abstract Component newNodeComponent(String id, IModel<I> model)
Creates the node component.- Specified by:
newNodeComponentin classBaseTreeColumn<T extends TreeModel & Serializable,I extends TreeNode & Serializable,S>- Parameters:
id- component idmodel- model used to access theTreeNode- 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:
newCellin interfaceIGridColumn<T extends TreeModel & Serializable,I extends TreeNode & Serializable,S>- Overrides:
newCellin classBaseTreeColumn<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
-
newCell
public final IRenderable<I> newCell(IModel<I> rowModel)
Creates 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<T extends TreeModel & Serializable,I extends TreeNode & Serializable,S>- Overrides:
newCellin classAbstractColumn<T extends TreeModel & Serializable,I extends TreeNode & Serializable,S>- Parameters:
rowModel- model for given row- Returns:
IRenderableinstance
-
-