org.apache.wicket.extensions.markup.html.tree.table
Class AbstractTreeColumn

java.lang.Object
  extended by org.apache.wicket.extensions.markup.html.tree.table.AbstractColumn
      extended by org.apache.wicket.extensions.markup.html.tree.table.AbstractTreeColumn
All Implemented Interfaces:
java.io.Serializable, IColumn, IClusterable
Direct Known Subclasses:
PropertyTreeColumn

public abstract class AbstractTreeColumn
extends AbstractColumn

Convenience class for building tree columns, i.e. columns that contain the actual tree.

Author:
Matej Knopp
See Also:
Serialized Form

Constructor Summary
AbstractTreeColumn(ColumnLocation location, java.lang.String header)
          Creates new column.
 
Method Summary
 Component newCell(MarkupContainer parent, java.lang.String id, javax.swing.tree.TreeNode node, int level)
          This method is used to populate the cell for given node in case when IColumn.newCell(TreeNode, int) returned null.
 IRenderable newCell(javax.swing.tree.TreeNode node, int level)
          Creates the IRenderable instance for given node.
abstract  java.lang.String renderNode(javax.swing.tree.TreeNode node)
          Returns the string representation of the node.
 
Methods inherited from class org.apache.wicket.extensions.markup.html.tree.table.AbstractColumn
getLocation, getSpan, getTreeTable, isVisible, newHeader, setTreeTable
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

AbstractTreeColumn

public AbstractTreeColumn(ColumnLocation location,
                          java.lang.String header)
Creates new column. Checks if the column is not aligned in middle. In case it is, throws an exception.

Parameters:
location - Specifies how the column should be aligned and what his size should be
header - Header caption
Method Detail

newCell

public Component newCell(MarkupContainer parent,
                         java.lang.String id,
                         javax.swing.tree.TreeNode node,
                         int level)
Description copied from interface: IColumn
This method is used to populate the cell for given node in case when IColumn.newCell(TreeNode, int) returned null.

Parameters:
parent - The parent to which the cell must be added. Can also be used to find the TreeTable instance (using parent.findParent(TreeTable.cass))
id - The component id
node - TreeNode for the cell
level - Convenience parameter that indicates how deep the node is in hierarchy
Returns:
The populated cell component
See Also:
IColumn.newCell(MarkupContainer, String, TreeNode, int)

newCell

public IRenderable newCell(javax.swing.tree.TreeNode node,
                           int level)
Description copied from interface: IColumn
Creates the IRenderable instance for given node. IRenderable can be used as lightweight alternative to regular Component for cells, that don't require user interaction (just display data).

If this method returns null, IColumn.newCell(MarkupContainer, String, TreeNode, int) is used to popuplate the cell.

Parameters:
node - TreeNode for the cell
level - Convenience parameter that indicates how deep the node is in hierarchy
Returns:
The cell renderer
See Also:
IColumn.newCell(TreeNode, int)

renderNode

public abstract java.lang.String renderNode(javax.swing.tree.TreeNode node)
Returns the string representation of the node.

Parameters:
node - The node
Returns:
The string representation of the node


Copyright © 2004-2010 Apache Software Foundation. All Rights Reserved.