com.cc.framework.taglib.base
Class ImageTag

java.lang.Object
  extended byjavax.servlet.jsp.tagext.TagSupport
      extended bycom.cc.framework.taglib.base.ImageTag
All Implemented Interfaces:
javax.servlet.jsp.tagext.IterationTag, javax.servlet.jsp.tagext.JspTag, java.io.Serializable, javax.servlet.jsp.tagext.Tag
Direct Known Subclasses:
ImageMappingTag

public class ImageTag
extends javax.servlet.jsp.tagext.TagSupport

Tag handler for the image Tag. The tag generates an HTML-image element. The image tag can also be used in conjunction with other tags of the framework. The surrounding tag is responsible in this case for the display of the image. Thus, the image is not directly written into the HTML-page. The tag-handler of the surrounding tag must implement the com.cc.framework.taglib.ImageContainerTag Interface.

Since:
1.0
Version:
$Revision: 1.31 $
Author:
Harald Schulz
See Also:
Serialized Form

Field Summary
private  java.lang.Object directValue
          A direct set value
private  ImageMap imagemap
          The name of the image map.
private  ImageModelImp model
          The image model
private  java.lang.String name
          The name of the bean containing our underlying property.
private  java.lang.String property
          The name of the property.
private static long serialVersionUID
          Serial Version UID
 
Fields inherited from class javax.servlet.jsp.tagext.TagSupport
id, pageContext
 
Fields inherited from interface javax.servlet.jsp.tagext.IterationTag
EVAL_BODY_AGAIN
 
Fields inherited from interface javax.servlet.jsp.tagext.Tag
EVAL_BODY_INCLUDE, EVAL_PAGE, SKIP_BODY, SKIP_PAGE
 
Constructor Summary
ImageTag()
          Constructor for ImageTag
 
Method Summary
 int doEndTag()
           
 int doStartTag()
           
 java.lang.Object getDirectValue()
          Returns a direct set value
protected  ImageModelImp getImage()
          Returns the image model
protected  java.lang.Object lookupBean()
          Retrieves the bean which holds the Display Data or Control Instance
 void release()
           
protected  void releaseImage()
          Releases the image model
 void setAlt(java.lang.String alt)
          Sets the text to display if the image can't be displayed.
 void setHeight(java.lang.String height)
          Sets the height of the image
 void setImagemap(java.lang.String mapName)
          Specifies the name of an image map which must be saved in the request.
 void setName(java.lang.String name)
          Specifies the name of the Java-Bean.
 void setPageContext(javax.servlet.jsp.PageContext pc)
           
 void setProperty(java.lang.String property)
          Sets the Property-Attribute
 void setResource(java.lang.String resource)
          Uses a image resource from the applications resource maps to setup the image
 void setSrc(java.lang.String src)
          Sets the image src attribute
 void setStyle(java.lang.String style)
          An HTML-style.
 void setStyleClass(java.lang.String styleClass)
          The HTML-class attribute.
 void setStyleId(java.lang.String styleId)
          The HTML-id attribute.
 void setTooltip(java.lang.String tooltip)
          Sets a tooltip text for this image
 void setValue(java.lang.String value)
          Sets the direct value for this image.
 void setWidth(java.lang.String width)
          Sets the image width
 
Methods inherited from class javax.servlet.jsp.tagext.TagSupport
doAfterBody, findAncestorWithClass, getId, getParent, getValue, getValues, removeValue, setId, setParent, setValue
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

serialVersionUID

private static final long serialVersionUID
Serial Version UID

See Also:
Constant Field Values

model

private ImageModelImp model
The image model


directValue

private java.lang.Object directValue
A direct set value


name

private java.lang.String name
The name of the bean containing our underlying property.


property

private java.lang.String property
The name of the property.


imagemap

private ImageMap imagemap
The name of the image map.

Constructor Detail

ImageTag

public ImageTag()
Constructor for ImageTag

Method Detail

getImage

protected ImageModelImp getImage()
Returns the image model

Returns:
ImageModel

releaseImage

protected void releaseImage()
Releases the image model


release

public void release()
See Also:
Tag.release()

setPageContext

public void setPageContext(javax.servlet.jsp.PageContext pc)
See Also:
Tag.setPageContext(PageContext pc)

lookupBean

protected java.lang.Object lookupBean()
                               throws javax.servlet.jsp.JspException
Retrieves the bean which holds the Display Data or Control Instance

Returns:
Bean (Control instance or DataModel)
Throws:
javax.servlet.jsp.JspException - Is thrown when the bean could not be found

doEndTag

public int doEndTag()
             throws javax.servlet.jsp.JspException
Throws:
javax.servlet.jsp.JspException
See Also:
Tag.doEndTag()

doStartTag

public int doStartTag()
               throws javax.servlet.jsp.JspException
Throws:
javax.servlet.jsp.JspException
See Also:
Tag.doStartTag()

setValue

public void setValue(java.lang.String value)
Sets the direct value for this image. This will overwrite the value of the property attribute

Parameters:
value - The image value

getDirectValue

public java.lang.Object getDirectValue()
Returns a direct set value

Returns:
Value

setName

public void setName(java.lang.String name)
Specifies the name of the Java-Bean. The Java-Bean must be stored in the given scope.

Parameters:
name - Name of the Bean

setProperty

public void setProperty(java.lang.String property)
                 throws javax.servlet.jsp.JspException
Sets the Property-Attribute

Parameters:
property - The Property-Attribute
Throws:
javax.servlet.jsp.JspException

setImagemap

public void setImagemap(java.lang.String mapName)
                 throws javax.servlet.jsp.JspException
Specifies the name of an image map which must be saved in the request. The values that the property returns are mapped to the entries of this image map. The mapping is done with the help of the regular expression, which is assigned to every entry of the image map.

Parameters:
mapName - The ImageMap to assign
Throws:
javax.servlet.jsp.JspException - If the ImageMap can not be found

setTooltip

public void setTooltip(java.lang.String tooltip)
Sets a tooltip text for this image

Parameters:
tooltip - Tooltip text

setAlt

public void setAlt(java.lang.String alt)
Sets the text to display if the image can't be displayed.

Parameters:
alt - String the alternative text.

setHeight

public void setHeight(java.lang.String height)
               throws javax.servlet.jsp.JspException
Sets the height of the image

Parameters:
height - the height of the image
Throws:
javax.servlet.jsp.JspException - If the argument can not be converted into an integer value

setSrc

public void setSrc(java.lang.String src)
Sets the image src attribute

Parameters:
src - src attribute

setResource

public void setResource(java.lang.String resource)
Uses a image resource from the applications resource maps to setup the image

Parameters:
resource - resource key

setWidth

public void setWidth(java.lang.String width)
              throws javax.servlet.jsp.JspException
Sets the image width

Parameters:
width - the image width
Throws:
javax.servlet.jsp.JspException - If the argument can not be converted into an integer value

setStyle

public void setStyle(java.lang.String style)
An HTML-style. See HTML documentation for the attribute style.

Parameters:
style - An HTML-style

setStyleId

public void setStyleId(java.lang.String styleId)
The HTML-id attribute. See HTML documentation for the Attribute id.

Parameters:
styleId - The HTML-id attribute

setStyleClass

public void setStyleClass(java.lang.String styleClass)
The HTML-class attribute. See HTML documentation for the attribute class.

Parameters:
styleClass - The HTML-class attribute


Copyright © 2000-2005 SCC Informationssysteme GmbH. All Rights Reserved.