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

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

public class ImageAnchor
extends Anchor
implements IHtmlAccessable

Generates a URL-encoded hyperlink to a specified URI with an image enclosed as the body. ImageAnchor provides support for image rollovers. An imageAnchor must have one of five attributes to correctly create the hyperlink:

See Also:
Serialized Form
Example
In this sample, an <netui:imageAnchor> shows "top.jpg" at 25 x 25 pixels and navigates to index.jsp when clicked.
    <netui:imageAnchor href="index.jsp" src="top.jpg" height="25" width="25" />


Field Summary
 
Fields inherited from class AnchorBase
_clientAction, _linkName, _state, 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
ImageAnchor()
           
 
Method Summary
 int doEndTag()
          Render the image and hyperlink.
 int doStartTag()
          Insert rollover javascript.
 String getTagName()
          Return the name of the Tag.
protected  void localRelease()
          Release any acquired resources.
 void setAlign(String align)
          Sets the property to specify where to align the image.
 void setAlt(String alt)
          Sets the property to specify the alt text of the image.
 void setAttribute(String name, String value, String facet)
          Base support for the attribute tag.
 void setBorder(String border)
          Sets the border size around the image.
 void setHeight(String height)
          Sets the image height.
 void setHspace(String hspace)
          Sets the the horizontal spacing around the image.
 void setImageStyle(String imageStyle)
          Set the <img> style for the contained image.
 void setImageStyleClass(String imageClass)
          Set the label style class for each contained Image.
 void setIsmap(String ismap)
          Sets the server-side image map declaration.
 void setLongdesc(String longdesc)
          Sets the property to specify a link to the the long description to supplement the short description in the alt attribute.
 void setRolloverImage(String rolloverImage)
          Sets the roll-over image of the ImageAnchor.
 void setSrc(String src)
          Sets the image source URI.
 void setUsemap(String usemap)
          Sets the client-side image map declaration.
 void setVspace(String vspace)
          Sets the vertical spacing around the image.
 void setWidth(String width)
          Sets the image width.
 
Methods inherited from class Anchor
doAfterBody, getState, setCharSet, setClientAction, setHrefLang, setLinkName, setOnClick, setRel, setRev, setTarget, setType, setValue
 
Methods inherited from class AnchorBase
addParameter, createAnchorBeginTag, getPopupSupport, setAccessKey, setAction, setCoords, setDisableSecondClick, setFormSubmit, setHref, setLocation, setOnBlur, setOnFocus, setPopup, setShape, setTabindex, setTargetScope
 
Methods inherited from class HtmlBaseTag
getJavaScriptAttribute, getOnClick, getTagId, renderDefaultNameAndId, renderNameAndId, setDir, setLang, 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, getUserLocale, hasErrors, qualifyAttribute, registerTagError, registerTagError, reportAndExit, reportErrors, rewriteName, setNonEmptyValueAttribute, setRequiredValueAttribute, write
 
Methods inherited from class BodyTagSupport
doInitBody, 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 IHtmlAccessable
setAccessKey
 
Methods inherited from interface IHtmlCore
setStyle, setStyleClass, setTagId, setTitle
 
Methods inherited from interface Tag
getParent, setPageContext, setParent
 

Constructor Detail

ImageAnchor

public ImageAnchor()
Method Detail

getTagName

public String getTagName()
Return the name of the Tag.

Specified by:
getTagName in interface INetuiTag
Overrides:
getTagName in class Anchor
Returns:
the name of the tag.

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 src attribute. ImageAnchor supports two facets, image and anchor. The default facet is anchor, meaning if the facet is not specified, the attribute will be applied to the <a> element. To apply an attribute to the <img> element you must specify the image facet.

Specified by:
setAttribute in interface IAttributeConsumer
Overrides:
setAttribute in class AnchorBase
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.

setAlign

public void setAlign(String align)
Sets the property to specify where to align the image.

Parameters:
align - the image alignment.

setAlt

public void setAlt(String alt)
Sets the property to specify the alt text of the image.

Specified by:
setAlt in interface IHtmlAccessable
Parameters:
alt - the image alignment.

setLongdesc

public void setLongdesc(String longdesc)
Sets the property to specify a link to the the long description to supplement the short description in the alt attribute.

Parameters:
longdesc - the longdesc.

setBorder

public void setBorder(String border)
Sets the border size around the image.

Parameters:
border - the border size.

setHeight

public void setHeight(String height)
Sets the image height.

Parameters:
height - the height.

setHspace

public void setHspace(String hspace)
Sets the the horizontal spacing around the image.

Parameters:
hspace - the horizontal spacing.

setIsmap

public void setIsmap(String ismap)
Sets the server-side image map declaration.

Parameters:
ismap - the image map declaration.

setRolloverImage

public void setRolloverImage(String rolloverImage)
Sets the roll-over image of the ImageAnchor.

Parameters:
rolloverImage - the rollover image.

setSrc

public void setSrc(String src)
            throws JspException
Sets the image source URI.

Parameters:
src - the image source URI.
Throws:
JspException

setUsemap

public void setUsemap(String usemap)
Sets the client-side image map declaration.

Parameters:
usemap - the map declaration.

setVspace

public void setVspace(String vspace)
Sets the vertical spacing around the image.

Parameters:
vspace - the vertical spacing.

setImageStyle

public void setImageStyle(String imageStyle)
Set the <img> style for the contained image. When the tag library is running in legacy mode, this will override the style attribute if that is set. If this is not set, and style is set, then it will be applied to the image.

Parameters:
imageStyle - the label style

setImageStyleClass

public void setImageStyleClass(String imageClass)
Set the label style class for each contained Image. When the tag library is running in legacy mode, this will override the styleClass attribute if that is set. If this is not set, and styleClass is set, then it will be applied to the image.

Parameters:
imageClass - the image class

setWidth

public void setWidth(String width)
Sets the image width.

Parameters:
width - the image width.

doStartTag

public int doStartTag()
               throws JspException
Insert rollover javascript.

Support for indexed property since Struts 1.1

Specified by:
doStartTag in interface Tag
Overrides:
doStartTag in class Anchor
Throws:
JspException - if a JSP exception has occurred

doEndTag

public int doEndTag()
             throws JspException
Render the image and hyperlink.

Specified by:
doEndTag in interface Tag
Overrides:
doEndTag in class Anchor
Throws:
JspException - if a JSP exception has occurred

localRelease

protected void localRelease()
Release any acquired resources.

Overrides:
localRelease in class AnchorBase