org.tinyjee.maven.dim.extensions
Class TableLayoutParameterTransformer

java.lang.Object
  extended by org.tinyjee.maven.dim.extensions.AbstractParameterTransformer
      extended by org.tinyjee.maven.dim.extensions.TableLayoutParameterTransformer
All Implemented Interfaces:
RequestParameterTransformer

public class TableLayoutParameterTransformer
extends AbstractParameterTransformer

This extension re-arranges selected document sections (hierarchical headlines in Doxia) using a table of columns and rows.

The actual layout is created using a specified number of columns and rows and does gracefully fallback to the standard layout if client side javascript is not available.

Author:
Juergen_Kellerer, 2011-11-08

Field Summary
static String PARAM_CELL_STYLE
          Optional Parameter: Defines the CSS style of the TD elements.
static String PARAM_COLUMN_CLASSES
          Optional Parameter: Specifies a comma separates list of classes to apply with the columns.
static String PARAM_COLUMN_WIDTHS
          Optional Parameter: Specifies a comma separates list of width values (CSS format) to apply with the columns.
static String PARAM_COLUMNS
          Specifies the number of columns to render (defaults to '*').
static String PARAM_DIRECTION
          Defines the direction for placing the sections in the table layout (defaults to 'top-down').
static String PARAM_GAP
          Defines the gab (margin) between the table cells (defaults to '10pt').
static String PARAM_ROW_CLASSES
          Optional Parameter: Specifies a comma separates list of classes to apply with the rows.
static String PARAM_ROW_HEIGHTS
          Optional Parameter: Specifies a comma separates list of height values (CSS format) to apply with the rows.
static String PARAM_ROWS
          Specifies the number of rows to render (defaults to '*').
static String PARAM_STYLE
          Optional Parameter: Defines the CSS style of the container hosting the elements.
static String PARAM_STYLE_CLASS
          Optional Parameter: Defines the CSS style class of the container hosting the elements.
static String PARAM_TABLE_LAYOUT
          Enables this extension and sets a regular expression matching the section titles that should be transformed into a tabs.
static String PARAM_WIDTH
          Defines the width of the layout (defaults to '100%').
 
Fields inherited from interface org.tinyjee.maven.dim.spi.RequestParameterTransformer
TRANSFORMERS
 
Constructor Summary
TableLayoutParameterTransformer()
           
 
Method Summary
protected  boolean doTransformParameters(Map<String,Object> params)
           
 
Methods inherited from class org.tinyjee.maven.dim.extensions.AbstractParameterTransformer
isSourceSet, transformParameters
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

PARAM_TABLE_LAYOUT

public static final String PARAM_TABLE_LAYOUT
Enables this extension and sets a regular expression matching the section titles that should be transformed into a tabs.

Note: Setting this property has no effect in case of "source" or "source-class" were specified with the macro call. This behaviour ensures that the parameter "tabbed-panel" can still be used with ordinary macro calls where a source or source-class was set.

This parameter expects a regular expression that is used to select what sections are placed inside the table layout by matching the given section titles (headlines).
By default the javascript looks for the first section that follows the include position and continues with all siblings (sections of the same level). Neither parent nor child sections are processed, therefore it's mostly safe to use the match all expression .* if all sub-sequent sections of the same nesting level should be formatted with table layout.

Examples:

See Also:
Constant Field Values

PARAM_COLUMNS

public static final String PARAM_COLUMNS
Specifies the number of columns to render (defaults to '*').

If this parameter is set to asterisk ("*") the number of columns is unbounded and calculates out of the number of sections divided by the defined rows. If both columns and rows is set to asterisk the number of columns equals the number of sections while the number of rows becomes "1".

See Also:
Constant Field Values

PARAM_ROWS

public static final String PARAM_ROWS
Specifies the number of rows to render (defaults to '*').

If this parameter is set to asterisk ("*") the number of rows is unbounded and calculates out of the number of sections divided by the defined columns.

See Also:
Constant Field Values

PARAM_DIRECTION

public static final String PARAM_DIRECTION
Defines the direction for placing the sections in the table layout (defaults to 'top-down').

Possible values:

See Also:
Constant Field Values

PARAM_GAP

public static final String PARAM_GAP
Defines the gab (margin) between the table cells (defaults to '10pt').

Note: The gap can also be defined for the horizontal or vertical direction using horizontal-gap and vertical-gap.

See Also:
Constant Field Values

PARAM_WIDTH

public static final String PARAM_WIDTH
Defines the width of the layout (defaults to '100%').

See Also:
Constant Field Values

PARAM_STYLE

public static final String PARAM_STYLE
Optional Parameter: Defines the CSS style of the container hosting the elements.

Example - Creates a right aligned floating box of all "Hints":

 %{include|table-layout=.*(Hint).*|columns=1|width=200|style=border: 1px solid gray; background-color:#eee; float: right;}

See Also:
Constant Field Values

PARAM_STYLE_CLASS

public static final String PARAM_STYLE_CLASS
Optional Parameter: Defines the CSS style class of the container hosting the elements.

See Also:
Constant Field Values

PARAM_CELL_STYLE

public static final String PARAM_CELL_STYLE
Optional Parameter: Defines the CSS style of the TD elements.

See Also:
Constant Field Values

PARAM_COLUMN_WIDTHS

public static final String PARAM_COLUMN_WIDTHS
Optional Parameter: Specifies a comma separates list of width values (CSS format) to apply with the columns. The number of width values doesn't need to match the number of actual columns as missing values are interpolated.

See Also:
Constant Field Values

PARAM_COLUMN_CLASSES

public static final String PARAM_COLUMN_CLASSES
Optional Parameter: Specifies a comma separates list of classes to apply with the columns. The number of classes doesn't need to match the number of actual columns as missing values are interpolated.

See Also:
Constant Field Values

PARAM_ROW_HEIGHTS

public static final String PARAM_ROW_HEIGHTS
Optional Parameter: Specifies a comma separates list of height values (CSS format) to apply with the rows. The number of height values doesn't need to match the number of actual rows as missing values are interpolated.

See Also:
Constant Field Values

PARAM_ROW_CLASSES

public static final String PARAM_ROW_CLASSES
Optional Parameter: Specifies a comma separates list of classes to apply with the rows. The number of classes doesn't need to match the number of actual rows as missing values are interpolated.

See Also:
Constant Field Values
Constructor Detail

TableLayoutParameterTransformer

public TableLayoutParameterTransformer()
Method Detail

doTransformParameters

protected boolean doTransformParameters(Map<String,Object> params)
Specified by:
doTransformParameters in class AbstractParameterTransformer