|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
ObjectSimpleTagSupport
AbstractSimpleTag
AbstractDataGridHtmlTag
AbstractCell
HeaderCell
public class HeaderCell
This tag is used to render an HTML table header cell and should generally be used inside of the data grid's
Header
tag. Cells rendered with this tag usually appear at the top of a column of data displayed
in a grid. Content for the body of a table header cell can be specified in one of two ways:
setHeaderText(String)
attributeSimpleTag
.
If the header text attribute is provided, it will supercede the content rendered by the body, though the body
will still be evaluated.
The header cell is also able to display UI for showing and changing the sort and filter state of a data grid.
By default, this tag renders a clickable arrow indicating the sort state and allow ing a page user to change
the sort state. The state of a sort is usually associated with the data displayed in a column though the
data in the column and the expression used to sort the data are loosely coupled via a 'sort expression'. The
sort expression text is used to lookup the Sort
state
from the DataGridState
associated with the containing
data grid. If sorts are found, this tag will render the appropriate UI for the sort. Only a single sort
may be associated with the sort expression. The clickable link rendered for changing the sort state is built
using either the setSortHref(String)
or the setSortAction(String)
attributes. Sort UI rendering
can be disabled using the setDisableSortRendering(boolean)
attribute. Custom UI can be rendered
for changing or displaying the sort state by providing a body for this tag and using the JSP EL data bindable
DataGridState
object available via the data
grid's dataGrid
implicit object.
The header cell provides attributes for supporting authoring of filter UI, but this tag does not by default implement a filter UI. The attributes are provided here so that their values can be data bound when building custom filter UI.
The set of JSP implicit objects available to the body include:
dataGrid
-- the DataGridTagModel
for the cell's containing data grid.cellModel
-- the CellModel
containing state for the attributes of this tag.
Constructor Summary | |
---|---|
HeaderCell()
|
Method Summary | |
---|---|
protected void |
applyAttributes()
Apply the tag's attributes to the HeaderCellModel . |
String |
getTagName()
The name of this tag; this value is used for error reporting. |
protected CellModel |
internalGetCellModel()
Implementation of AbstractCell.internalGetCellModel() that exposes the
HeaderCellModel
which is storing state for this tag. |
protected void |
renderCell(AbstractRenderAppender appender)
Render the header cell's contents. |
protected void |
renderHeaderCellContents(AbstractRenderAppender appender,
String jspFragmentOutput)
Render the contents of the body of the HTML th tag into the given AbstractRenderAppender |
void |
setAttribute(String name,
String value,
String facet)
Implementation of the IAttributeConsumer interface. |
void |
setBehavior(String name,
Object value,
String facet)
Implementation of the IBehaviorConsumer interface that extends the functionality of this
tag beyond that exposed via the JSP tag attributes. |
void |
setCellAbbr(String abbr)
Sets the value of the abbreviated form of the content for the HTML th tag. |
void |
setCellAlign(String align)
Sets the value of the horizontal align attribute for the HTML th tag.. |
void |
setCellAxis(String axis)
Sets the value of the axis attribute for the HTML th tag. |
void |
setCellChar(String alignChar)
Sets the value of the horizontal alignment character attribute for the HTML th tag. |
void |
setCellCharoff(String alignCharOff)
Sets the value of the horizontal alignment character offset for the HTML th tag.. |
void |
setCellColspan(int colSpan)
Sets the value of the colspan attribute for the HTML th tag. |
void |
setCellDir(String dir)
Sets the value of the text direction attribute for the HTML th tag. |
void |
setCellHeaders(String headers)
Sets the value of the headers attribute for the HTML th tag. |
void |
setCellLang(String lang)
Sets the value of the language attribute for the HTML th tag. |
void |
setCellOnClick(String onClick)
Sets the onClick JavaScript for the HTML th tag. |
void |
setCellOnDblClick(String onDblClick)
Sets the onDblClick JavaScript for the HTML th tag. |
void |
setCellOnKeyDown(String onKeyDown)
Sets the onKeyDown JavaScript for the HTML th tag. |
void |
setCellOnKeyPress(String onKeyPress)
Sets the onKeyPress JavaScript for the HTML th tag. |
void |
setCellOnKeyUp(String onKeyUp)
Sets the onKeyUp JavaScript for the HTML th tag. |
void |
setCellOnMouseDown(String onMouseDown)
Sets the onMouseDown JavaScript for the HTML th tag. |
void |
setCellOnMouseMove(String onMouseMove)
Sets the onMouseMove JavaScript for the HTML th tag. |
void |
setCellOnMouseOut(String onMouseOut)
Sets the onMouseOut JavaScript for the HTML th tag. |
void |
setCellOnMouseOver(String onMouseOver)
Sets the onMouseOver JavaScript for the HTML th tag. |
void |
setCellOnMouseUp(String onMouseUp)
Sets the onMouseUp JavaScript for the HTML th tag. |
void |
setCellRowspan(int rowSpan)
Sets the value of the rowspan attribute for the HTML th tag. |
void |
setCellScope(String scope)
Sets the value of the scope attribute for the HTML th tag. |
void |
setCellStyle(String style)
Sets the style for the HTML th tag. |
void |
setCellStyleClass(String styleClass)
Sets the style class for the HTML th tag. |
void |
setCellTagId(String tagId)
Set the name of the tagId for the HTML th tag. |
void |
setCellTitle(String title)
Sets the value of the title attribute for the HTML th tag. |
void |
setCellValign(String align)
Sets the value of the vertical alignment attribute for the HTML th tag. |
void |
setDisableFilterRendering(boolean disableFilterRendering)
Set a boolean which can be used to enable / disable rendering of UI associated with filtering inside of the data grid. |
void |
setDisableSortRendering(boolean disableSortRendering)
Set a boolean which can be used to enable / disable rendering of UI associated with sorting inside of the data grid. |
void |
setFilterAction(String filterAction)
Set the name of an action used to perform filtering on a data grid. |
void |
setFilterExpression(String filterExpression)
Set the filter expression for this header cell. |
void |
setFilterHref(String filterHref)
Set an href used to build URIs to change the filter state for this header cell. |
void |
setHeaderText(String headerText)
Deprecated. |
void |
setScopeId(String scopeId)
Sets the scopeId for any anchors rendered by this header cell. |
void |
setSortAction(String sortAction)
Set the name of an action used to perform sorting on a data grid. |
void |
setSortExpression(String sortExpression)
Set the sort expression for this header cell. |
void |
setSortHref(String sortHref)
Set an href used to build URIs to change the sort state for this header cell. |
void |
setValue(Object value)
Deprecated. |
Methods inherited from class AbstractCell |
---|
addFormatter, addStateAttribute, doTag, formatterHasError, renderEmptyCell |
Methods inherited from class AbstractDataGridHtmlTag |
---|
applyIndexedTagId, applyTagId, lookupDataGridTagModel, renderDefaultNameAndId, renderNameAndId |
Methods inherited from class AbstractSimpleTag |
---|
getBufferBody, getHtmlTag, getIdForTagId, getInlineError, getPageContext, getScriptReporter, 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 |
Methods inherited from interface IFormattable |
---|
addFormatter, formatterHasError |
Constructor Detail |
---|
public HeaderCell()
Method Detail |
---|
public String getTagName()
getTagName
in interface INetuiTag
getTagName
in class AbstractSimpleTag
public void setHeaderText(String headerText)
headerText
- The text to render.public void setValue(Object value)
value
- The text to format and renderpublic void setScopeId(String scopeId)
scopeId
- public void setDisableFilterRendering(boolean disableFilterRendering)
disableFilterRendering
- boolean to enable / disable filter UI renderingpublic void setFilterExpression(String filterExpression)
Filter
state for a data grid
If filters are found matching this filter expression, the column is said to be 'filtered'. When
a column is filtered, it is possible for the header cell UI to change to allow changing or
removing the filter. By default, no UI is rendered for filtered columns. To have data cells
rendered with filter information, this filter expression value should be set on the
AbstractHtmlTableCell.setFilterExpression(String)
attribute for cell tags rendered
inside of the Rows
tag.
filterExpression
- the filter expressionpublic void setFilterAction(String filterAction)
setFilterHref(String)
may be
set on this tag.
filterAction
- the filter actionpublic void setFilterHref(String filterHref)
setFilterAction(String)
attribute may be set on this tag.
filterHref
- the filter hrefpublic void setDisableSortRendering(boolean disableSortRendering)
disableSortRendering
- boolean to enable / disable sort UI renderingpublic void setSortExpression(String sortExpression)
Sort
state for a data grid
If sorts are found matching this filter expression, the column is said to be 'sorted'. When
a column is sorted, it is possible for the header cell UI to change to allow changing or
removing the filter. By default, the UI for sorting is a clickable arrow that indicates whether
a column of data is sorted ascending, descending, or not at all. To have data cells
rendered with sort information, this sort expression value should be set on the
AbstractHtmlTableCell.setSortExpression(String)
attribute for cell tags rendered
inside of the Rows
tag.
sortExpression
- the sort expressionpublic void setSortAction(String sortAction)
setSortHref(String)
may be
set on this tag.
sortAction
- the sort actionpublic void setSortHref(String sortHref)
setSortAction(String)
attribute may be set on this tag.
sortHref
- the sort hrefpublic void setCellOnClick(String onClick)
onClick
- the onClick event.public void setCellOnDblClick(String onDblClick)
onDblClick
- the onDblClick event.public void setCellOnKeyDown(String onKeyDown)
onKeyDown
- the onKeyDown event.public void setCellOnKeyUp(String onKeyUp)
onKeyUp
- the onKeyUp event.public void setCellOnKeyPress(String onKeyPress)
onKeyPress
- the onKeyPress event.public void setCellOnMouseDown(String onMouseDown)
onMouseDown
- the onMouseDown event.public void setCellOnMouseUp(String onMouseUp)
onMouseUp
- the onMouseUp event.public void setCellOnMouseMove(String onMouseMove)
onMouseMove
- the onMouseMove event.public void setCellOnMouseOut(String onMouseOut)
onMouseOut
- the onMouseOut event.public void setCellOnMouseOver(String onMouseOver)
onMouseOver
- the onMouseOver event.public void setCellStyle(String style)
style
- the stylepublic void setCellStyleClass(String styleClass)
styleClass
- the style classpublic void setCellTitle(String title)
title
- the titlepublic void setCellRowspan(int rowSpan)
rowSpan
- the rowspanpublic void setCellColspan(int colSpan)
colSpan
- the colspanpublic void setCellAlign(String align)
align
- the horizontal alignmentpublic void setCellChar(String alignChar)
alignChar
- the alignment characterpublic void setCellCharoff(String alignCharOff)
alignCharOff
- the horizontal alignment character offsetpublic void setCellValign(String align)
align
- the vertical alignment attributepublic void setCellLang(String lang)
lang
- the language attributepublic void setCellDir(String dir)
dir
- the text directionpublic void setCellAbbr(String abbr)
abbr
- the abbrpublic void setCellAxis(String axis)
axis
- the axispublic void setCellHeaders(String headers)
headers
- the headerspublic void setCellScope(String scope)
scope
- the scopepublic void setCellTagId(String tagId) throws JspException
tagId
- the the name of the tagId for the th tag.
JspException
public void setAttribute(String name, String value, String facet) throws JspException
Implementation of the IAttributeConsumer
interface. This
allows users of the anchorCell tag to extend the attribute set that is rendered by the HTML
anchor. This method accepts the following facets:
Facet Name | Operation |
header | Adds an attribute with the provided name and value to the
attributes rendered on the <th> tag. |
setAttribute
in interface IAttributeConsumer
name
- the name of the attributevalue
- the value of the attributefacet
- the facet for the attribute
JspException
- thrown when the facet is not recognizedpublic void setBehavior(String name, Object value, String facet) throws JspException
Implementation of the IBehaviorConsumer
interface that extends the functionality of this
tag beyond that exposed via the JSP tag attributes. This method accepts the following facets:
Facet Name | Operation |
renderer | Extends the cell decorator chain used to implement rendering for this tag |
renderer
facet accepts the following behavior names. The value of each should be a String classname
of a class that extends the CellDecorator
base class.
extends | Add an additional decorator to the currently configured cell decorator chain. |
sort | Replace the currently configured sort decorator with one created from this class name. |
setBehavior
in interface IBehaviorConsumer
name
- the name of the behaviorvalue
- the value of the behaviorfacet
- th ebehavior's facet
JspException
- when the behavior's facet isnot recognizedprotected CellModel internalGetCellModel()
AbstractCell.internalGetCellModel()
that exposes the
HeaderCellModel
which is storing state for this tag.
internalGetCellModel
in class AbstractCell
protected void renderCell(AbstractRenderAppender appender) throws IOException, JspException
renderHeaderCellContents(org.apache.beehive.netui.tags.rendering.AbstractRenderAppender, String)
method to render the contents of the cell.
renderCell
in class AbstractCell
appender
- the AbstractRenderAppender
to which the output from this tag should be added
IOException
JspException
protected void renderHeaderCellContents(AbstractRenderAppender appender, String jspFragmentOutput) throws IOException, JspException
AbstractRenderAppender
appender
- the AbstractRenderAppender
for the outputjspFragmentOutput
- the result of having evaluated the tag's JspFragment
IOException
- when an error occurs writing to the output stream
JspException
- when an error occurs evaluating the JspFragment
for this bodyprotected void applyAttributes() throws JspException
HeaderCellModel
.
applyAttributes
in class AbstractCell
JspException
- when errors are encountered applying the attributes
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |