org.apache.beehive.netui.tags.databinding.datagrid
Class AbstractHtmlTableCell

Object
  extended by SimpleTagSupport
      extended by AbstractSimpleTag
          extended by AbstractDataGridHtmlTag
              extended by AbstractCell
                  extended by AbstractHtmlTableCell
All Implemented Interfaces:
JspTag, SimpleTag, IAttributeConsumer, IBehaviorConsumer, INetuiTag
Direct Known Subclasses:
AnchorCell, ImageAnchorCell, ImageCell, SpanCell, TemplateCell

public abstract class AbstractHtmlTableCell
extends AbstractCell
implements IAttributeConsumer, IBehaviorConsumer

Abstract base class that supports rendering an HTML <td>. This tag should be used as the base class for all tags which render content during the data grid's DataGridTagModel.RENDER_STATE_GRID render state. Subclasses must implement the renderDataCellContents(org.apache.beehive.netui.tags.rendering.AbstractRenderAppender, String) which will be invoked after the opening table cell tag and before the closing table cell tag.

State attributes set via the setCell* methods are added to the attribute set used when rendering the <td> tag.


Constructor Summary
AbstractHtmlTableCell()
           
 
Method Summary
protected  void renderCell(AbstractRenderAppender appender)
           Base HTML table cell rendering functionality which opens and closes the HTML <td> tags with the correct style and attribute information.
protected abstract  void renderDataCellContents(AbstractRenderAppender appender, String output)
           Abstract method implemented by subclasses in order to render a cell's content.
 void setAttribute(String name, String value, String facet)
           Base support for setting attributes on a tag via the IAttributeConsumer interface.
 void setBehavior(String name, Object value, String facet)
           Base support for setting behavior values via the IBehaviorConsumer interface.
 void setCellAbbr(String abbr)
          Sets the value of the abbreviated form of the HTML table cell's content.
 void setCellAlign(String align)
          Sets the horizontal alignment of the HTML table cell.
 void setCellAxis(String axis)
          Sets the value of the axis attribute for the HTML table cell.
 void setCellChar(String alignChar)
          Sets the value of the horizontal alignment character attribute for the HTML table cell.
 void setCellCharoff(String alignCharOff)
          Sets the value of the horizontal alignment character offset attribute for the HTML table cell.
 void setCellColspan(int colSpan)
          Sets the colspan attribute of the HTML table cell.
 void setCellDir(String dir)
          Sets the value of the text direction attribute for the HTML table cell.
 void setCellHeaders(String headers)
          Sets the value of the headers attribute for the HTML table cell.
 void setCellLang(String lang)
          Sets the value of the language attribute for the HTML table cell.
 void setCellOnClick(String onClick)
          Sets the onClick JavaScript event for the HTML table cell.
 void setCellOnDblClick(String onDblClick)
          Sets the onDblClick javascript event for the HTML table cell.
 void setCellOnKeyDown(String onKeyDown)
          Sets the onKeyDown javascript event for the HTML table cell.
 void setCellOnKeyPress(String onKeyPress)
          Sets the onKeyPress javascript event for the HTML table cell.
 void setCellOnKeyUp(String onKeyUp)
          Sets the onKeyUp javascript event for the HTML table cell.
 void setCellOnMouseDown(String onMouseDown)
          Sets the onMouseDown javascript event for the HTML table cell.
 void setCellOnMouseMove(String onMouseMove)
          Sets the onMouseMove javascript event for the HTML table cell.
 void setCellOnMouseOut(String onMouseOut)
          Sets the onMouseOut javascript event for the HTML table cell.
 void setCellOnMouseOver(String onMouseOver)
          Sets the onMouseOver javascript event for the HTML table cell.
 void setCellOnMouseUp(String onMouseUp)
          Sets the onMouseUp javascript event for the HTML table cell.
 void setCellRowspan(int rowSpan)
          Sets the rowspan attribute for the HTML table cell.
 void setCellScope(String scope)
          Sets the value of the scope attribute for the HTML table cell.
 void setCellStyle(String style)
          Sets the style attribute for the HTML table cell.
 void setCellStyleClass(String styleClass)
          Sets the style class attribute for the HTML table cell.
 void setCellTagId(String tagId)
          Set the name of the tagId for the HTML table cell.
 void setCellTitle(String title)
          Sets the value of the title attribute for the HTML table cell.
 void setCellValign(String align)
          Sets the value of the vertical alignment attribute for the HTML table cell.
 void setFilterExpression(String filterExpression)
           Set the filter expression with which this cell should be associated.
 void setSortExpression(String sortExpression)
           Set the sort expression with which this cell should be associated.
 
Methods inherited from class AbstractCell
addFormatter, addStateAttribute, applyAttributes, doTag, formatterHasError, internalGetCellModel, renderEmptyCell
 
Methods inherited from class AbstractDataGridHtmlTag
applyIndexedTagId, applyTagId, lookupDataGridTagModel, renderDefaultNameAndId, renderNameAndId
 
Methods inherited from class AbstractSimpleTag
getBufferBody, getHtmlTag, getIdForTagId, getInlineError, getPageContext, getScriptReporter, getTagName, getUserLocale, hasErrors, registerTagError, registerTagError, reportErrors, rewriteName, setNonEmptyValueAttribute, setRequiredValueAttribute, write
 
Methods inherited from class SimpleTagSupport
findAncestorWithClass, getJspBody, getJspContext, getParent, setJspBody, setJspContext, setParent
 
Methods inherited from class Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

AbstractHtmlTableCell

public AbstractHtmlTableCell()
Method Detail

setSortExpression

public void setSortExpression(String sortExpression)

Set the sort expression with which this cell should be associated. Cells use this value to lookup any Sort state that may apply to this cell. Often, this value matches a HeaderCell.setSortExpression(String) set on a header cell. It is used by data cells to render styles representing sorted data.

Parameters:
sortExpression - the sort expression

setFilterExpression

public void setFilterExpression(String filterExpression)

Set the filter expression with which this cell should be associated. Cells use this value to lookup any Filter state that may apply to this cell. Often, this value matches a HeaderCell.setFilterExpression(String) set on a header cell. It is used by data cells to render styles representing filtered data.

Parameters:
filterExpression - the filter expression

setCellOnClick

public void setCellOnClick(String onClick)
Sets the onClick JavaScript event for the HTML table cell.

Parameters:
onClick - the onClick event.

setCellOnDblClick

public void setCellOnDblClick(String onDblClick)
Sets the onDblClick javascript event for the HTML table cell.

Parameters:
onDblClick - the onDblClick event.

setCellOnKeyDown

public void setCellOnKeyDown(String onKeyDown)
Sets the onKeyDown javascript event for the HTML table cell.

Parameters:
onKeyDown - the onKeyDown event.

setCellOnKeyUp

public void setCellOnKeyUp(String onKeyUp)
Sets the onKeyUp javascript event for the HTML table cell.

Parameters:
onKeyUp - the onKeyUp event.

setCellOnKeyPress

public void setCellOnKeyPress(String onKeyPress)
Sets the onKeyPress javascript event for the HTML table cell.

Parameters:
onKeyPress - the onKeyPress event.

setCellOnMouseDown

public void setCellOnMouseDown(String onMouseDown)
Sets the onMouseDown javascript event for the HTML table cell.

Parameters:
onMouseDown - the onMouseDown event.

setCellOnMouseUp

public void setCellOnMouseUp(String onMouseUp)
Sets the onMouseUp javascript event for the HTML table cell.

Parameters:
onMouseUp - the onMouseUp event.

setCellOnMouseMove

public void setCellOnMouseMove(String onMouseMove)
Sets the onMouseMove javascript event for the HTML table cell.

Parameters:
onMouseMove - the onMouseMove event.

setCellOnMouseOut

public void setCellOnMouseOut(String onMouseOut)
Sets the onMouseOut javascript event for the HTML table cell.

Parameters:
onMouseOut - the onMouseOut event.

setCellOnMouseOver

public void setCellOnMouseOver(String onMouseOver)
Sets the onMouseOver javascript event for the HTML table cell.

Parameters:
onMouseOver - the onMouseOver event.

setCellStyle

public void setCellStyle(String style)
Sets the style attribute for the HTML table cell.

Parameters:
style - the html style.

setCellStyleClass

public void setCellStyleClass(String styleClass)
Sets the style class attribute for the HTML table cell.

Parameters:
styleClass - the html style class.

setCellTitle

public void setCellTitle(String title)
Sets the value of the title attribute for the HTML table cell.

Parameters:
title - the title

setCellRowspan

public void setCellRowspan(int rowSpan)
Sets the rowspan attribute for the HTML table cell.

Parameters:
rowSpan - the rowspan

setCellColspan

public void setCellColspan(int colSpan)
Sets the colspan attribute of the HTML table cell.

Parameters:
colSpan - the colspan

setCellAlign

public void setCellAlign(String align)
Sets the horizontal alignment of the HTML table cell.

Parameters:
align - the alignment

setCellChar

public void setCellChar(String alignChar)
Sets the value of the horizontal alignment character attribute for the HTML table cell.

Parameters:
alignChar - the horizontal alignment character

setCellCharoff

public void setCellCharoff(String alignCharOff)
Sets the value of the horizontal alignment character offset attribute for the HTML table cell.

Parameters:
alignCharOff - the alingnment character offset

setCellValign

public void setCellValign(String align)
Sets the value of the vertical alignment attribute for the HTML table cell.

Parameters:
align - the vertical alignment

setCellLang

public void setCellLang(String lang)
Sets the value of the language attribute for the HTML table cell.

Parameters:
lang - the language

setCellDir

public void setCellDir(String dir)
Sets the value of the text direction attribute for the HTML table cell.

Parameters:
dir - the text direction

setCellAbbr

public void setCellAbbr(String abbr)
Sets the value of the abbreviated form of the HTML table cell's content.

Parameters:
abbr - the abbreviation

setCellAxis

public void setCellAxis(String axis)
Sets the value of the axis attribute for the HTML table cell.

Parameters:
axis - the axis

setCellHeaders

public void setCellHeaders(String headers)
Sets the value of the headers attribute for the HTML table cell.

Parameters:
headers - the headers

setCellScope

public void setCellScope(String scope)
Sets the value of the scope attribute for the HTML table cell.

Parameters:
scope - the scope

setCellTagId

public void setCellTagId(String tagId)
                  throws JspException
Set the name of the tagId for the HTML table cell. The user is responsible for ensuring that this tag id is unique in the rendered page.

Parameters:
tagId - the tag id
Throws:
JspException

setAttribute

public void setAttribute(String name,
                         String value,
                         String facet)
                  throws JspException

Base support for setting attributes on a tag via the IAttributeConsumer interface. The AbstractHtmlTableCell does not support any attributes by default. Attributes set via this interface are used to extend the HTML attributes exposed through the JSP tags themselves. This allows tag users to add arbitrary attributes to the HTML tags rendered by the data grid.

Specified by:
setAttribute in interface IAttributeConsumer
Parameters:
name - The name of the attribute.
value - The value of the attribute.
facet - The name of a facet to which the attribute will be applied. This is optional.
Throws:
JspException

setBehavior

public void setBehavior(String name,
                        Object value,
                        String facet)
                 throws JspException

Base support for setting behavior values via the IBehaviorConsumer interface. The AbstractHtmlTableCell does not support any attributes by default. Attributes set via this interface are used to configure internal functionality of the tags which is not exposed via JSP tag attributes.

Specified by:
setBehavior in interface IBehaviorConsumer
Parameters:
name - the name of the behavior
value - the value of the behavior
facet - the name of a facet of the tag to which the behavior will be applied. This is optional.
Throws:
JspException

renderCell

protected void renderCell(AbstractRenderAppender appender)
                   throws IOException,
                          JspException

Base HTML table cell rendering functionality which opens and closes the HTML <td> tags with the correct style and attribute information. Between the table cell tags, the tag calls the renderDataCellContents(org.apache.beehive.netui.tags.rendering.AbstractRenderAppender, String) method so that subclasses implementing this method can provide content inside of the table cell.

The style information rendered here includes the following in order:

  1. the StyleModel.getDataCellFilteredClass() if the cell has a filter expression and is filtered
  2. the StyleModel.getDataCellSortedClass() if the cell has a sort expression and is sorted
  3. the setCellStyleClass(String) attribute if set; StyleModel.getDataCellClass() otherwise

Specified by:
renderCell in class AbstractCell
Parameters:
appender - the AbstractRenderAppender to which any output should be rendered
Throws:
IOException
JspException

renderDataCellContents

protected abstract void renderDataCellContents(AbstractRenderAppender appender,
                                               String output)
                                        throws IOException,
                                               JspException

Abstract method implemented by subclasses in order to render a cell's content.

Parameters:
appender - the AbstractRenderAppender to which any output should be rendered
output - the output produced from having evaluated this tag's JspFragment
Throws:
IOException
JspException