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

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

public abstract class AbstractColumn
extends Object
implements IColumn

Convenience class for building tree columns.

Author:
Matej Knopp
See Also:
Serialized Form

Constructor Summary
AbstractColumn(ColumnLocation location, String header)
          Creates the tree column.
 
Method Summary
 ColumnLocation getLocation()
          Returns a location of this column.
 int getSpan(TreeNode node)
          Returns the span for this cell.
protected  TreeTable getTreeTable()
          Returns the tree table that this columns belongs to.
 boolean isVisible()
          Returns, whether the column is visible.
 Component newHeader(MarkupContainer parent, String id)
          Creates the header element for this column.
 void setTreeTable(TreeTable treeTable)
          Sets the tree table this cell belongs to.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface org.apache.wicket.extensions.markup.html.tree.table.IColumn
newCell, newCell
 

Constructor Detail

AbstractColumn

public AbstractColumn(ColumnLocation location,
                      String header)
Creates the tree column.

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

getLocation

public ColumnLocation getLocation()
Description copied from interface: IColumn
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.

Specified by:
getLocation in interface IColumn
Returns:
The location of this column
See Also:
IColumn.getLocation()

getSpan

public int getSpan(TreeNode node)
Description copied from interface: IColumn
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.

Specified by:
getSpan in interface IColumn
Parameters:
node - The tree node
Returns:
The span of the column
See Also:
IColumn.getSpan(TreeNode)

isVisible

public boolean isVisible()
Description copied from interface: IColumn
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.

Specified by:
isVisible in interface IColumn
Returns:
Whether the column is visible
See Also:
IColumn.isVisible()

newHeader

public Component newHeader(MarkupContainer parent,
                           String id)
Description copied from interface: IColumn
Creates the header element for this column. In most situations this will be just a simple label showing column title.

Specified by:
newHeader in interface IColumn
Parameters:
parent - The parent component
id - The component id
Returns:
The header component
See Also:
IColumn.newHeader(MarkupContainer, String)

setTreeTable

public void setTreeTable(TreeTable treeTable)
Description copied from interface: IColumn
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.

Specified by:
setTreeTable in interface IColumn
Parameters:
treeTable - The tree table
See Also:
IColumn.setTreeTable(TreeTable)

getTreeTable

protected TreeTable getTreeTable()
Returns the tree table that this columns belongs to. If you call this method from constructor it will return null, as the column is constructed before the tree is.

Returns:
The tree table this column belongs to


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