org.apache.wicket.extensions.markup.html.tree.table
Interface IColumn

All Superinterfaces:
IClusterable, java.io.Serializable
All Known Implementing Classes:
AbstractColumn, AbstractRenderableColumn, AbstractTreeColumn, PropertyEditableColumn, PropertyRenderableColumn, PropertyTreeColumn

public interface IColumn
extends IClusterable

Interface that represents a column in TreeTable.

Author:
Matej Knopp

Method Summary
 ColumnLocation getLocation()
          Returns a location of this column.
 int getSpan(javax.swing.tree.TreeNode node)
          Returns the span for this cell.
 boolean isVisible()
          Returns, whether the column is visible.
 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 newCell(TreeNode, int) returned null.
 IRenderable newCell(javax.swing.tree.TreeNode node, int level)
          Creates the IRenderable instance for given node.
 Component newHeader(MarkupContainer parent, java.lang.String id)
          Creates the header element for this column.
 void setTreeTable(TreeTable treeTable)
          Sets the tree table this cell belongs to.
 

Method Detail

getLocation

ColumnLocation getLocation()
Returns a location of this column. Location specifies how is column aligned and what is it's size.

In case location of a column changes, it is necessary to call the invalidateAll methods on the TreeTable to prevent incorrect rendering.

Returns:
The location of this column

getSpan

int getSpan(javax.swing.tree.TreeNode node)
Returns the span for this cell. This method is called only for cells that are aligned in the middle.

The returned value implicates, over how many cells the cell in this column (in row determined by node) should span. This is analogical to colspan property of html element td.

Parameters:
node - The tree node
Returns:
The span of the column

isVisible

boolean isVisible()
Returns, whether the column is visible.

In case the visibility changes, it is necessary to call the invalidateAll methods on the TreeTable to prevent incorrect rendering.

Returns:
Whether the column is visible

newCell

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 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

newCell

IRenderable newCell(javax.swing.tree.TreeNode node,
                    int level)
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, 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

newHeader

Component newHeader(MarkupContainer parent,
                    java.lang.String id)
Creates the header element for this column. In most situations this will be just a simple label showing column title.

Parameters:
parent - The parent component
id - The component id
Returns:
The header component

setTreeTable

void setTreeTable(TreeTable treeTable)
Sets the tree table this cell belongs to. This function is guaranteed to be called before any other function. The treeTable instance is fully initialized.

Parameters:
treeTable - The tree table


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