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

Object
  extended by CellDecorator
Direct Known Subclasses:
AnchorCellDecorator, HeaderCellDecorator, ImageAnchorCellDecorator, ImageCellDecorator, SortedCellDecorator, SpanCellDecorator

public abstract class CellDecorator
extends Object

Abstract basee class used to render the contents of a data grid cell. CellDecorators are used so that code used to render the contents of a data grid cell can be chained together in order to compose different rendering patterns. For example, an HTML anchor and image decorator could be composed together to create an image anchor renderer. In addition, cell decoration can be used to display UI exposing custom data grid features such as sort or filter UI on data grid header cells.

CellDecorators are intended to be stateless. State required for rendering should be passed to a CellDecorator using an instance of a CellModel class.


Constructor Summary
CellDecorator()
          Default constructor.
CellDecorator(CellDecorator cellDecorator)
          Constructor that takes a nested CellDecorator.
 
Method Summary
abstract  void decorate(JspContext jspContext, AbstractRenderAppender appender, CellModel cellModel)
          This method is implemented by subclasses to provide decoration behavior.
 CellDecorator getNestedDecorator()
          Get the nested decorator.
 void setNestedDecorator(CellDecorator cellDecorator)
          Set the nested cell decorator.
 
Methods inherited from class Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

CellDecorator

public CellDecorator()
Default constructor.


CellDecorator

public CellDecorator(CellDecorator cellDecorator)
Constructor that takes a nested CellDecorator.

Parameters:
cellDecorator - the nested decorator which can optionally be used by implementations to render additional UI for the cell.
Method Detail

getNestedDecorator

public CellDecorator getNestedDecorator()
Get the nested decorator.

Returns:
the cell decorator if one has been provided. null otherwise.

setNestedDecorator

public void setNestedDecorator(CellDecorator cellDecorator)
Set the nested cell decorator.

Parameters:
cellDecorator - the cell decorator.

decorate

public abstract void decorate(JspContext jspContext,
                              AbstractRenderAppender appender,
                              CellModel cellModel)
                       throws CellDecoratorException
This method is implemented by subclasses to provide decoration behavior. The use of a nested CellDecorator is left to specific implementations; it is possible that some implementations will ignore such nested instances.

Parameters:
jspContext - the JspContext for the current page
appender - the AbstractRenderAppender to which markup should be rendered
cellModel - the CellModel JavaBean that contains
Throws:
CellDecoratorException - an exception thrown when an error occurs running the decorator.