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

Object
  extended by SimpleTagSupport
      extended by AbstractSimpleTag
          extended by AbstractDataGridHtmlTag
              extended by AbstractCell
                  extended by AbstractHtmlTableCell
                      extended by AnchorCell
All Implemented Interfaces:
JspTag, SimpleTag, IFormattable, IUrlParams, IAttributeConsumer, IBehaviorConsumer, IHtmlCore, IHtmlEvents, IHtmlI18n, INetuiTag

public class AnchorCell
extends AbstractHtmlTableCell
implements IFormattable, IUrlParams, IHtmlCore, IHtmlEvents, IHtmlI18n

Data grid cell used to render an HTML anchor. This tag should be used inside of a <netui-data:rows> tag when rendering a data set with the <netui-data:dataGrid> tag. An AnchorCell is used to render an HTML <a> tag. The rendered href is provided with either the action or href attributes. If an action is provided, the action must exist inside of the 'current' Page Flow with which the JSP is associated. If the href is provided, the anchor will use this value as its rendered href. For example:

   <netui-data:anchorCell href="foo.jsp" value="Go To Foo"/>
 
will render:
   <a href="foo.jsp">Go To Foo</a>
 

The AnchorCell tag can also accept NetUI parameter tags that implement the IUrlParams interface. When these tags are contained inside of this tag, they add URL parameters onto the rendered href. For example:

   
     
   
 
will render:
   <a href="foo.jsp?paramKey=paramValue">Go To Foo</a>
 

The set of JSP implicit objects available to the body include:


Constructor Summary
AnchorCell()
           
 
Method Summary
 void addParameter(String name, Object value, String facet)
           Implementation of the IUrlParams interface.
protected  void applyAttributes()
           Interanl method overriding the AbstractCell.applyAttributes() method to handle setting attributes on the AnchorCellModel associated with an instance of this tag.
 String getTagName()
          The name of this tag; this value is used for error reporting.
protected  CellModel internalGetCellModel()
          Implementation of AbstractCell.internalGetCellModel() that exposes the AnchorCellModel which is storing state for the tag's anchor.
protected  void renderDataCellContents(AbstractRenderAppender appender, String jspFragmentOutput)
          Render the contents of the HTML anchor.
 void setAccessKey(char accessKey)
          Sets the accessKey attribute value.
 void setAction(String action)
          Set the name of the action for the HTML anchor.
 void setAttribute(String name, String value, String facet)
           Implementation of the IAttributeConsumer interface.
 void setCharset(String charSet)
          Sets charset attribute for the HTML anchor.
 void setDir(String dir)
          Sets the dir attribute for the HTML anchor.
 void setHref(String href)
          Sets the href of the HTML anchor.
 void setHrefLang(String hreflang)
          Sets hreflang attribute for the anchor.
 void setLang(String lang)
          Sets the lang attribute for the HTML anchor.
 void setOnBlur(String onblur)
          Sets the onBlur JavaScript event for the HTML anchor.
 void setOnClick(String onClick)
          Sets the onClick JavaScript event for the HTML anchor.
 void setOnDblClick(String onDblClick)
          Sets the onDblClick JavaScript event for the HTML anchor.
 void setOnFocus(String onfocus)
          Sets the onFocus JavaScript event for the HTML anchor.
 void setOnKeyDown(String onKeyDown)
          Sets the onKeyDown JavaScript event for the HTML anchor.
 void setOnKeyPress(String onKeyPress)
          Sets the onKeyPress JavaScript event for the HTML anchor.
 void setOnKeyUp(String onKeyUp)
          Sets the onKeyUp JavaScript event for the HTML anchor.
 void setOnMouseDown(String onMouseDown)
          Sets the onMouseDown JavaScript event for the HTML anchor.
 void setOnMouseMove(String onMouseMove)
          Sets the onMouseMove JavaScript event for the HTML anchor.
 void setOnMouseOut(String onMouseOut)
          Sets the onMouseOut JavaScript event for the HTML anchor.
 void setOnMouseOver(String onMouseOver)
          Sets the onMouseOver JavaScript event for the HTML anchor.
 void setOnMouseUp(String onMouseUp)
          Sets the onMouseUp JavaScript event for the HTML anchor.
 void setRel(String rel)
          Sets rel attribute for the HTML anchor.
 void setRev(String rev)
          Sets rev attribute for the HTML anchor.
 void setStyle(String style)
          Sets the style of the HTML anchor.
 void setStyleClass(String styleClass)
          Sets the style class of the HTML anchor.
 void setTabindex(int tabindex)
          Sets the tabIndex of the rendered html tag.
 void setTagId(String tagId)
           Set the name of the tagId for the HTML anchor.
 void setTarget(String target)
          Sets the window target for the HTML anchor.
 void setTargetScope(String targetScope)
          Set the target "scope" for the anchor's action.
 void setTitle(String title)
          Sets the value of the title attribute for the HTML anchor
 void setType(String type)
          Sets type attribute for the HTML anchor.
 void setValue(Object value)
          The text displayed for the HTML anchor.
 
Methods inherited from class AbstractHtmlTableCell
renderCell, setBehavior, setCellAbbr, setCellAlign, setCellAxis, setCellChar, setCellCharoff, setCellColspan, setCellDir, setCellHeaders, setCellLang, setCellOnClick, setCellOnDblClick, setCellOnKeyDown, setCellOnKeyPress, setCellOnKeyUp, setCellOnMouseDown, setCellOnMouseMove, setCellOnMouseOut, setCellOnMouseOver, setCellOnMouseUp, setCellRowspan, setCellScope, setCellStyle, setCellStyleClass, setCellTagId, setCellTitle, setCellValign, setFilterExpression, setSortExpression
 
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

AnchorCell

public AnchorCell()
Method Detail

getTagName

public String getTagName()
The name of this tag; this value is used for error reporting.

Specified by:
getTagName in interface INetuiTag
Specified by:
getTagName in class AbstractSimpleTag
Returns:
the String name of this tag

setOnClick

public void setOnClick(String onClick)
Sets the onClick JavaScript event for the HTML anchor.

Specified by:
setOnClick in interface IHtmlEvents
Parameters:
onClick - the onClick event for the HTML anchor.

setOnDblClick

public void setOnDblClick(String onDblClick)
Sets the onDblClick JavaScript event for the HTML anchor.

Specified by:
setOnDblClick in interface IHtmlEvents
Parameters:
onDblClick - the onDblClick event.

setOnKeyDown

public void setOnKeyDown(String onKeyDown)
Sets the onKeyDown JavaScript event for the HTML anchor.

Specified by:
setOnKeyDown in interface IHtmlEvents
Parameters:
onKeyDown - the onKeyDown event.

setOnKeyUp

public void setOnKeyUp(String onKeyUp)
Sets the onKeyUp JavaScript event for the HTML anchor.

Specified by:
setOnKeyUp in interface IHtmlEvents
Parameters:
onKeyUp - the onKeyUp event.

setOnKeyPress

public void setOnKeyPress(String onKeyPress)
Sets the onKeyPress JavaScript event for the HTML anchor.

Specified by:
setOnKeyPress in interface IHtmlEvents
Parameters:
onKeyPress - the onKeyPress event.

setOnMouseDown

public void setOnMouseDown(String onMouseDown)
Sets the onMouseDown JavaScript event for the HTML anchor.

Specified by:
setOnMouseDown in interface IHtmlEvents
Parameters:
onMouseDown - the onMouseDown event.

setOnMouseUp

public void setOnMouseUp(String onMouseUp)
Sets the onMouseUp JavaScript event for the HTML anchor.

Specified by:
setOnMouseUp in interface IHtmlEvents
Parameters:
onMouseUp - the onMouseUp event.

setOnMouseMove

public void setOnMouseMove(String onMouseMove)
Sets the onMouseMove JavaScript event for the HTML anchor.

Specified by:
setOnMouseMove in interface IHtmlEvents
Parameters:
onMouseMove - the onMouseMove event.

setOnMouseOut

public void setOnMouseOut(String onMouseOut)
Sets the onMouseOut JavaScript event for the HTML anchor.

Specified by:
setOnMouseOut in interface IHtmlEvents
Parameters:
onMouseOut - the onMouseOut event.

setOnMouseOver

public void setOnMouseOver(String onMouseOver)
Sets the onMouseOver JavaScript event for the HTML anchor.

Specified by:
setOnMouseOver in interface IHtmlEvents
Parameters:
onMouseOver - the onMouseOver event.

setStyle

public void setStyle(String style)
Sets the style of the HTML anchor.

Specified by:
setStyle in interface IHtmlCore
Parameters:
style - the style attribute

setStyleClass

public void setStyleClass(String styleClass)
Sets the style class of the HTML anchor.

Specified by:
setStyleClass in interface IHtmlCore
Parameters:
styleClass - the style attribute.

setTitle

public void setTitle(String title)
Sets the value of the title attribute for the HTML anchor

Specified by:
setTitle in interface IHtmlCore
Parameters:
title - the title attribute

setCharset

public void setCharset(String charSet)
Sets charset attribute for the HTML anchor.

Parameters:
charSet - the charSet attribute for the HTML anchor.

setType

public void setType(String type)
Sets type attribute for the HTML anchor.

Parameters:
type - the type attribute

setHrefLang

public void setHrefLang(String hreflang)
Sets hreflang attribute for the anchor.

Parameters:
hreflang - the hreflang attribute

setRel

public void setRel(String rel)
Sets rel attribute for the HTML anchor.

Parameters:
rel - the rel attribute

setRev

public void setRev(String rev)
Sets rev attribute for the HTML anchor.

Parameters:
rev - the rev target for the HTML anchor

setTarget

public void setTarget(String target)
Sets the window target for the HTML anchor.

Parameters:
target - the window target for the HTML anchor.

setHref

public void setHref(String href)
Sets the href of the HTML anchor. This attribute will accept the empty String as a legal value.

Parameters:
href - the hyperlink URI for the HTML anchor.

setTargetScope

public void setTargetScope(String targetScope)
Set the target "scope" for the anchor's action. Multiple active page flows may exist concurrently within named scopes. This attribute selects which named scope to use. If omitted, the default scope is assumed.

Parameters:
targetScope - the name of the target scope in which the associated action's page flow resides.

setValue

public void setValue(Object value)
The text displayed for the HTML anchor.

Parameters:
value - the text displayed for the HTML anchor

setAction

public void setAction(String action)
               throws JspException
Set the name of the action for the HTML anchor. The action method must be in the Page Flow with which the containing JSP is associated.

Parameters:
action - the name of the action to set for the Area.
Throws:
JspException

setLang

public void setLang(String lang)
Sets the lang attribute for the HTML anchor.

Specified by:
setLang in interface IHtmlI18n
Parameters:
lang -

setDir

public void setDir(String dir)
Sets the dir attribute for the HTML anchor.

Specified by:
setDir in interface IHtmlI18n
Parameters:
dir -

setAccessKey

public void setAccessKey(char accessKey)
Sets the accessKey attribute value. This should key value of the keyboard navigation key. It is recommended not to use the following values because there are often used by browsers A, C, E, F, G, H, V, left arrow, and right arrow.

Parameters:
accessKey - the accessKey value.

setTabindex

public void setTabindex(int tabindex)
Sets the tabIndex of the rendered html tag.

Parameters:
tabindex - the tab index.

setOnBlur

public void setOnBlur(String onblur)
Sets the onBlur JavaScript event for the HTML anchor.

Parameters:
onblur - the onBlur event.

setOnFocus

public void setOnFocus(String onfocus)
Sets the onFocus JavaScript event for the HTML anchor.

Parameters:
onfocus - the onFocus event.

setTagId

public void setTagId(String tagId)
              throws JspException

Set the name of the tagId for the HTML anchor. The provided tagId will have the index of the current row added as a suffix in order to keep the anchor tagIds unique in the page.

Specified by:
setTagId in interface IHtmlCore
Parameters:
tagId - the the tagId for the HTML anchor.
Throws:
JspException

setAttribute

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 NameOperation
anchorAdds an attribute with the provided name and value to the attributes rendered on the <a> tag.
The AnchorCell tag defaults to the setting attributes on the anchor when the facet name is unset.

Specified by:
setAttribute in interface IAttributeConsumer
Overrides:
setAttribute in class AbstractHtmlTableCell
Parameters:
name - the name of the attribute
value - the value of the attribute
facet - the facet for the attribute
Throws:
JspException - thrown when the facet is not recognized

addParameter

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

Implementation of the IUrlParams interface. This allows this tag to accept <netui:parameter> and <netui:parameterMap> in order to add URL parameters onto the rendered anchor. For example:

   
       
   
 
will render an HTML anchor as:
   addParameter in interface IUrlParams
Parameters:
name - the name of the parameter
value - the value of the parameter
facet - the facet for the parameter
Throws:
JspException - thrown when the facet is unsupported

applyAttributes

protected void applyAttributes()
                        throws JspException

Interanl method overriding the AbstractCell.applyAttributes() method to handle setting attributes on the AnchorCellModel associated with an instance of this tag.

Overrides:
applyAttributes in class AbstractCell
Throws:
JspException - when an error occurs applying attributes to the cell model.

renderDataCellContents

protected void renderDataCellContents(AbstractRenderAppender appender,
                                      String jspFragmentOutput)
Render the contents of the HTML anchor. This method calls to an CellDecorator associated with this tag. The result of renderingi is appended to the appender

Specified by:
renderDataCellContents in class AbstractHtmlTableCell
Parameters:
appender - the AbstractRenderAppender to which output should be rendered
jspFragmentOutput - the result of having evaluated this tag's JspFragment

internalGetCellModel

protected CellModel internalGetCellModel()
Implementation of AbstractCell.internalGetCellModel() that exposes the AnchorCellModel which is storing state for the tag's anchor.

Specified by:
internalGetCellModel in class AbstractCell
Returns:
this tag's anchor cell model