org.apache.beehive.netui.databinding.datagrid.api.rendering
Class StyleModel

Object
  extended by StyleModel
Direct Known Subclasses:
DefaultStyleModel

public abstract class StyleModel
extends Object

JavaBean base class that creates HTML style class names used to render various HTML elements in the data grid.


Constructor Summary
StyleModel()
          Default constructor.
StyleModel(String stylePrefix)
          Constructor that takes a style prefix string.
 
Method Summary
protected  String buildStyleClass(String baseStyle)
          Given a base style class name, this method adds a style prefix to produce a complete style class.
 String buildStyleClassValue(List styleClasses)
          Build the value of the HTML style class attribute from the List of style classes.
abstract  String getAltRowClass()
          Get the style class for an HTML tr tag rendered in a grid row.
abstract  String getCaptionClass()
          Get the style class for an HTML caption tag.
abstract  String getDataCellClass()
          Get the style class for an HTML td tag rendered for a grid cell.
abstract  String getDataCellFilteredClass()
          Get the style class for an HTML td tag for a grid cell that is filtered.
abstract  String getDataCellSortedClass()
          Get the style class for an HTML td tag for a grid cell that is sorted.
abstract  String getFooterRowClass()
          Get the style class for an HTML tr tag rendered in the grid's footer.
abstract  String getHeaderCellClass()
          Get the style class for an HTML th tag rendered for a grid's header cell.
abstract  String getHeaderCellFilteredClass()
          Get the style class for an HTML th tag for a grid's header cell that is filtered.
abstract  String getHeaderCellSortableClass()
          Get the style class for an HTML th tag for a grid's header cell that is sortable.
abstract  String getHeaderCellSortedClass()
          Get the style class for an HTML th tag for a grid's header cell whose data is sorted.
abstract  String getHeaderRowClass()
          Get the style class for an HTML tr tag rendered in the grid's header.
abstract  String getRowClass()
          Get the style class for an HTML tr tag rendered in a grid row.
 String getStylePrefix()
          Get the style prefix
abstract  String getTableClass()
          Get the style class for an HTML table tag.
abstract  String getTableFootClass()
          Get the style class for an HTML tfoot tag.
abstract  String getTableHeadClass()
          Get the style class for an HTML thead tag.
 void setStylePrefix(String stylePrefix)
          Set the style prefix.
 
Methods inherited from class Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

StyleModel

public StyleModel()
Default constructor.


StyleModel

public StyleModel(String stylePrefix)
Constructor that takes a style prefix string. If a style prefix is provided, StyleModel subclasses should use this as a prefix to any style names that are produced.

Parameters:
stylePrefix - the prefix to use for styles
Method Detail

setStylePrefix

public void setStylePrefix(String stylePrefix)
Set the style prefix.

Parameters:
stylePrefix - the style prefix

getStylePrefix

public String getStylePrefix()
Get the style prefix

Returns:
the style prefix

getTableClass

public abstract String getTableClass()
Get the style class for an HTML table tag.

Returns:
the style class

getCaptionClass

public abstract String getCaptionClass()
Get the style class for an HTML caption tag.

Returns:
the style class

getTableHeadClass

public abstract String getTableHeadClass()
Get the style class for an HTML thead tag.

Returns:
the style class

getTableFootClass

public abstract String getTableFootClass()
Get the style class for an HTML tfoot tag.

Returns:
the style class

getHeaderRowClass

public abstract String getHeaderRowClass()
Get the style class for an HTML tr tag rendered in the grid's header.

Returns:
the style class

getFooterRowClass

public abstract String getFooterRowClass()
Get the style class for an HTML tr tag rendered in the grid's footer.

Returns:
the style class

getRowClass

public abstract String getRowClass()
Get the style class for an HTML tr tag rendered in a grid row. This style class will be used on even numbered rows.

Returns:
the style class

getAltRowClass

public abstract String getAltRowClass()
Get the style class for an HTML tr tag rendered in a grid row. This style class will be used on odd numbered rows.

Returns:
the style class

getDataCellClass

public abstract String getDataCellClass()
Get the style class for an HTML td tag rendered for a grid cell.

Returns:
the style class

getHeaderCellClass

public abstract String getHeaderCellClass()
Get the style class for an HTML th tag rendered for a grid's header cell.

Returns:
the style class

getHeaderCellSortedClass

public abstract String getHeaderCellSortedClass()
Get the style class for an HTML th tag for a grid's header cell whose data is sorted.

Returns:
the style class

getHeaderCellSortableClass

public abstract String getHeaderCellSortableClass()
Get the style class for an HTML th tag for a grid's header cell that is sortable.

Returns:
the style class

getHeaderCellFilteredClass

public abstract String getHeaderCellFilteredClass()
Get the style class for an HTML th tag for a grid's header cell that is filtered.

Returns:
the style class

getDataCellSortedClass

public abstract String getDataCellSortedClass()
Get the style class for an HTML td tag for a grid cell that is sorted.

Returns:
the style class

getDataCellFilteredClass

public abstract String getDataCellFilteredClass()
Get the style class for an HTML td tag for a grid cell that is filtered.

Returns:
the style class

buildStyleClassValue

public String buildStyleClassValue(List styleClasses)
Build the value of the HTML style class attribute from the List of style classes. The style classes are converted into a string in their list order. For example, a list with contents:
  foo,bar,baz
 
will be convereted into a style class whose value is foo,bar,baz

Parameters:
styleClasses - the classes to render into a style class value
Returns:
the string style class or an empty string if no style classes are provided

buildStyleClass

protected String buildStyleClass(String baseStyle)
Given a base style class name, this method adds a style prefix to produce a complete style class.

Parameters:
baseStyle - the core style class name
Returns:
the style class