org.apache.beehive.netui.tags.html
Class AnchorBase

Object
  extended by TagSupport
      extended by BodyTagSupport
          extended by AbstractClassicTag
              extended by HtmlBaseTag
                  extended by AnchorBase
All Implemented Interfaces:
Serializable, BodyTag, IterationTag, JspTag, Tag, HtmlConstants, IUrlParams, IAttributeConsumer, IHtmlAttrs, IHtmlCore, IHtmlEvents, IHtmlI18n, INetuiTag
Direct Known Subclasses:
Anchor, Area

public abstract class AnchorBase
extends HtmlBaseTag
implements IUrlParams

This is the base class that provides most of the features necessary to create an anchor and an area. The Anchor and Area tags are created as subclasses of this tag. The Area tag is really a subset of the features, so certain attributes are not defined here, even though the backing fields are defined here and the utility code knows them. This may not be the best OO design, but the design is optimized for performance of rendering anchor elements.

See Also:
Serialized Form

Field Summary
protected  String _clientAction
           
protected  String _linkName
           
protected  AnchorTag.State _state
           
protected static String REQUIRED_ATTR
           
 
Fields inherited from class AbstractClassicTag
DefaultNamingChain, EMPTY_STRING, NETUI_UNIQUE_CNT
 
Fields inherited from class BodyTagSupport
bodyContent
 
Fields inherited from class TagSupport
id, pageContext
 
Fields inherited from interface HtmlConstants
ABBR, ACCEPT, ACCESSKEY, ACTION, ALIGN, ALINK, ALT, ANCHOR, AREA, AXIS, BACKGROUND, BASE, BGCOLOR, BODY, BORDER, BR, BUTTON, CAPTION, CELLPADDING, CELLSPACING, CHAR, CHAROFF, CHARSET, CHECKED, CLASS, COLS, COLSPAN, COORDS, DIR, DISABLED, DIV, ENCTYPE, FOR, FORM, FORM_GET, FORM_POST, FRAME, HEADERS, HEIGHT, HREF, HREFLANG, HSPACE, HTML, ID, IMAGE, INPUT, INPUT_BUTTON, INPUT_CHECKBOX, INPUT_FILE, INPUT_HIDDEN, INPUT_IMAGE, INPUT_PASSWORD, INPUT_RADIO, INPUT_RESET, INPUT_SUBMIT, INPUT_TEXT, ISMAP, LABEL, LANG, LANGUAGE, LINK, LONGDESC, MAXLENGTH, METHOD, NAME, ONBLUR, ONCHANGE, ONCLICK, ONDBLCLICK, ONFOCUS, ONKEYDOWN, ONKEYPRESS, ONKEYUP, ONLOAD, ONMOUSEDOWN, ONMOUSEMOVE, ONMOUSEOUT, ONMOUSEOVER, ONMOUSEUP, ONRESET, ONSELECT, ONSUBMIT, ONUNLOAD, OPTION, READONLY, REL, REV, ROWS, ROWSPAN, RULES, SCOPE, SCRIPT, SELECT, SHAPE, SIZE, SPAN, SRC, STYLE, SUMMARY, TABINDEX, TABLE, TARGET, TBODY, TD, TEXT, TEXTAREA, TFOOT, TH, THEAD, TITLE, TR, TYPE, USEMAP, VALIGN, VALUE, VLINK, VSPACE, WIDTH
 
Fields inherited from interface BodyTag
EVAL_BODY_BUFFERED, EVAL_BODY_TAG
 
Fields inherited from interface IterationTag
EVAL_BODY_AGAIN
 
Fields inherited from interface Tag
EVAL_BODY_INCLUDE, EVAL_PAGE, SKIP_BODY, SKIP_PAGE
 
Constructor Summary
AnchorBase()
           
 
Method Summary
 void addParameter(String name, Object value, String facet)
          Adds a URL parameter to the generated hyperlink.
protected  boolean createAnchorBeginTag(HttpServletRequest request, ByRef scriptRef, TagRenderingBase trb, AbstractRenderAppender writer, String requiredAttrs)
          This method will create the <a> portion of an anchor.
 PopupSupport getPopupSupport()
          Get a helper to provide popup support.
protected  void localRelease()
          Release any acquired resources.
 void setAccessKey(char accessKey)
          Sets the accessKey attribute value.
 void setAction(String action)
          Set the name of the action for the Area.
 void setAttribute(String name, String value, String facet)
          Base support for the attribute tag.
 void setCoords(String coords)
          Sets coords attribute for the area.
 void setDisableSecondClick(boolean disableSecondClick)
          When true, this anchor will disable itself after being clicked.
 void setFormSubmit(boolean formSubmit)
          Sets the formSubmit indicator.
 void setHref(String href)
          Sets the href of the Anchor.
 void setLocation(String location)
          Sets the anchor to be added to the end of the generated hyperlink.
 void setOnBlur(String onblur)
          Sets the onBlur javascript event.
 void setOnFocus(String onfocus)
          Sets the onFocus javascript event.
 void setPopup(boolean popup)
          Sets the popup indicator.
 void setShape(String shape)
          Sets shape attribute for the area.
 void setTabindex(int tabindex)
          Sets the tabIndex of the rendered html tag.
 void setTargetScope(String targetScope)
          Set the target "scope" for the anchor's action.
 
Methods inherited from class HtmlBaseTag
getJavaScriptAttribute, getOnClick, getState, getTagId, renderDefaultNameAndId, renderNameAndId, setDir, setLang, setOnClick, setOnDblClick, setOnKeyDown, setOnKeyPress, setOnKeyUp, setOnMouseDown, setOnMouseMove, setOnMouseOut, setOnMouseOver, setOnMouseUp, setStateAttribute, setStyle, setStyleClass, setTagId, setTitle
 
Methods inherited from class AbstractClassicTag
applyNamingChain, getErrorsReport, getIdForTagId, getNamingChain, getNearestForm, getNextId, getScriptReporter, getTagName, getUserLocale, hasErrors, qualifyAttribute, registerTagError, registerTagError, reportAndExit, reportErrors, rewriteName, setNonEmptyValueAttribute, setRequiredValueAttribute, write
 
Methods inherited from class BodyTagSupport
doAfterBody, doEndTag, doInitBody, doStartTag, getBodyContent, getPreviousOut, release, setBodyContent
 
Methods inherited from class TagSupport
findAncestorWithClass, getId, getParent, getValue, getValues, removeValue, setId, setPageContext, setParent, setValue
 
Methods inherited from class Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface Tag
getParent, setPageContext, setParent
 

Field Detail

REQUIRED_ATTR

protected static final String REQUIRED_ATTR
See Also:
Constant Field Values

_state

protected AnchorTag.State _state

_linkName

protected String _linkName

_clientAction

protected String _clientAction
Constructor Detail

AnchorBase

public AnchorBase()
Method Detail

setAttribute

public void setAttribute(String name,
                         String value,
                         String facet)
                  throws JspException
Base support for the attribute tag. This is overridden to prevent setting the href attribute.

Specified by:
setAttribute in interface IAttributeConsumer
Overrides:
setAttribute in class HtmlBaseTag
Parameters:
name - The name of the attribute. This value may not be null or the empty string.
value - The value of the attribute. This may contain an expression.
facet - The name of a facet to which the attribute will be applied. This is optional.
Throws:
JspException - A JspException may be thrown if there is an error setting the attribute.

setShape

public void setShape(String shape)
Sets shape attribute for the area.

Parameters:
shape - the window target.

setCoords

public void setCoords(String coords)
Sets coords attribute for the area.

Parameters:
coords - the window target.

setAction

public void setAction(String action)
               throws JspException
Set the name of the action for the Area.

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

setHref

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

Parameters:
href - the hyperlink URI for the Area.
Throws:
JspException

setLocation

public void setLocation(String location)
Sets the anchor to be added to the end of the generated hyperlink.

Parameters:
location - the name of the location 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.

setFormSubmit

public void setFormSubmit(boolean formSubmit)
Sets the formSubmit indicator.

Parameters:
formSubmit - whether or not the enclosing Form should be submitted.

setPopup

public void setPopup(boolean popup)
Sets the popup indicator.

Parameters:
popup - whether or not the anchor should open a popup window.

setDisableSecondClick

public void setDisableSecondClick(boolean disableSecondClick)
When true, this anchor will disable itself after being clicked.

Parameters:
disableSecondClick - when true, this anchor will disable itself after being clicked.

setTabindex

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

Parameters:
tabindex - the tab index.

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.

setOnBlur

public void setOnBlur(String onblur)
Sets the onBlur javascript event.

Parameters:
onblur - the onBlur event.

setOnFocus

public void setOnFocus(String onfocus)
Sets the onFocus javascript event.

Parameters:
onfocus - the onFocus event.

addParameter

public void addParameter(String name,
                         Object value,
                         String facet)
                  throws JspException
Adds a URL parameter to the generated hyperlink.

Specified by:
addParameter in interface IUrlParams
Parameters:
name - the name of the parameter to be added.
value - the value of the parameter to be added (a String or String[]).
facet -
Throws:
JspException

createAnchorBeginTag

protected final boolean createAnchorBeginTag(HttpServletRequest request,
                                             ByRef scriptRef,
                                             TagRenderingBase trb,
                                             AbstractRenderAppender writer,
                                             String requiredAttrs)
                                      throws JspException
This method will create the <a> portion of an anchor. It is called by subclasses, for example, the ImageAnchor relies on this code to generate the <a>.

Parameters:
scriptRef - a ByRef<String> that will contain any JavaScript that may need to be added to the generated HTML response.
Returns:
a boolean value indicating if an error occur creating the anchor.
Throws:
JspException

localRelease

protected void localRelease()
Release any acquired resources.

Overrides:
localRelease in class HtmlBaseTag

getPopupSupport

public PopupSupport getPopupSupport()
Get a helper to provide popup support.