org.xwiki.rendering.macro.container
Interface LayoutManager

All Known Implementing Classes:
ColumnsLayoutManager

@Role
public interface LayoutManager

Layout manager to handle layouting of a block container, based on a set of parameters. The layoutContainer(Block) function should read the container children and modify them accordingly to meet the required layout. Note that although the function can access the whole tree through the passed block, it is recommended that the changes are limited to the container block and its children. Also, usually the container block should be a group block. Parameters are used to pass various parameters required for the layouting (sizes, style options, etc).

Since:
2.5M2

Method Summary
 Object getParameter(String parameterName)
           
 void layoutContainer(Block container)
          Performs the layout of container, modifying the blocks inside.
 void setParameter(String parameterName, Object parameterValue)
          Sets a parameter needed for the layout.
 

Method Detail

layoutContainer

void layoutContainer(Block container)
Performs the layout of container, modifying the blocks inside.
TODO: might as well have been with a list of blocks as parameter, but I wanted to mimic the awt LayoutManager interface, which lays out a container and not a list of contents. Reviewer, WDYT?

Parameters:
container - the block whose contents to layout

setParameter

void setParameter(String parameterName,
                  Object parameterValue)
Sets a parameter needed for the layout.

Parameters:
parameterName - the name of the parameter to set
parameterValue - the value of the parameter

getParameter

Object getParameter(String parameterName)
Parameters:
parameterName - the name of the parameter whose value to return
Returns:
the value of the parameter identified by parameterName