public class CmsJspTagImage extends javax.servlet.jsp.tagext.BodyTagSupport implements I_CmsJspTagParamParent
构造器和说明 |
---|
CmsJspTagImage()
Creates a new image scaling tag instance.
|
限定符和类型 | 方法和说明 |
---|---|
void |
addParameter(java.lang.String name,
java.lang.String value)
Add a parameter to this tag.
|
int |
doEndTag() |
int |
doStartTag()
Returns
. |
java.lang.String |
getAlign()
Returns the value of the HTML "align" attribute.
|
java.lang.String |
getAlt()
Returns the value of the HTML "alt" attribute.
|
java.lang.String |
getBorder()
Returns the value of the HTML "border" attribute.
|
java.lang.String |
getCssclass()
Returns the value of the HTML "class" attribute.
|
java.lang.String |
getHeight()
Returns the scaling height for the image.
|
java.lang.String |
getHspace()
Returns the value of the HTML "hspace" attribute.
|
java.lang.String |
getId()
Returns the value of the HTML "id" attribute.
|
java.lang.String |
getLongdesc()
Returns the value of the HTML "longdesc" attribute.
|
java.lang.String |
getMaxHeight()
Returns the maximum scaling height for the image, only needed if scale type is 5.
|
java.lang.String |
getMaxWidth()
Returns the maximum scaling width for the image, only needed if scale type is 5.
|
java.lang.String |
getName()
Returns the value of the HTML "name" attribute.
|
java.lang.String |
getNoDim()
Returns
"true" if the created HTML image tag does not contain height and width attributes. |
java.lang.String |
getScaleColor()
Returns the background color used by the image scaler.
|
java.lang.String |
getScaleFilter()
Returns the filter list used by the image scaler.
|
java.lang.String |
getScalePosition()
Returns the position used by the image scaler.
|
java.lang.String |
getScaleQuality()
Returns the quality used by the image scaler.
|
static CmsImageScaler |
getScaler(CmsImageScaler scaler,
CmsImageScaler original,
java.lang.String scaleParam)
Creates the images scaler used by this image tag.
|
java.lang.String |
getScaleRendermode()
Returns the render mode used by the image scaler.
|
java.lang.String |
getScaleType()
Returns the scaling type for the image.
|
java.lang.String |
getSrc()
Returns the source of the image to scale,
which will have the OpenCms webapp / servlet prefix added.
|
java.lang.String |
getStyle()
Returns the value of the HTML "style" attribute.
|
java.lang.String |
getTitle()
Returns the value of the HTML "title" attribute.
|
java.lang.String |
getUsemap()
Returns the value of the HTML "usemap" attribute.
|
java.lang.String |
getVspace()
Returns the value of the HTML "vspace" attribute.
|
java.lang.String |
getWidth()
Returns the scaling width for the image.
|
static java.lang.String |
imageTagAction(java.lang.String src,
CmsImageScaler scaler,
java.util.Map<java.lang.String,java.lang.String> attributes,
boolean partialTag,
boolean noDim,
javax.servlet.ServletRequest req)
Internal action method to create the tag content.
|
static java.lang.String |
imageTagAction(java.lang.String src,
CmsImageScaler scaler,
java.util.Map<java.lang.String,java.lang.String> attributes,
boolean partialTag,
javax.servlet.ServletRequest req)
Internal action method to create the tag content.
|
java.lang.String |
isPartialTag()
Returns
"true" if the HTML tag should only be created as partial tag. |
void |
release() |
void |
setAlign(java.lang.String value)
Sets the value of the HTML "align" attribute.
|
void |
setAlt(java.lang.String value)
Sets the value of the HTML "alt" attribute.
|
void |
setBorder(java.lang.String value)
Sets the value of the HTML "border" attribute.
|
void |
setCssclass(java.lang.String value)
Sets the value of the HTML "class" attribute.
|
void |
setHeight(java.lang.String value)
Sets the scaling height for the image.
|
void |
setHspace(java.lang.String value)
Sets the value of the HTML "hspace" attribute.
|
void |
setId(java.lang.String value)
Sets the value of the HTML "id" attribute.
|
void |
setLongdesc(java.lang.String value)
Sets the value of the HTML "longdesc" attribute.
|
void |
setMaxHeight(java.lang.String value)
Sets the maximum scaling height for the image, only needed if scale type is 5.
|
void |
setMaxWidth(java.lang.String value)
Sets the maximum scaling width for the image, only needed if scale type is 5.
|
void |
setName(java.lang.String value)
Sets the value of the HTML "name" attribute.
|
void |
setNoDim(java.lang.String noDim)
Controls if the created HTML image tag contains height and width attributes.
|
void |
setPartialTag(java.lang.String partialTag)
Controls if the created HTML image tag is a full or partial tag.
|
void |
setScaleColor(java.lang.String value)
Sets the background color used by the image scaler.
|
void |
setScaleFilter(java.lang.String value)
Sets the filter(s) used by the image scaler.
|
void |
setScalePosition(java.lang.String value)
Sets the position used by the image scaler.
|
void |
setScaleQuality(java.lang.String value)
Sets the quality used by the image scaler.
|
void |
setScaleRendermode(java.lang.String value)
Sets the render mode used by the image scaler.
|
void |
setScaleType(java.lang.String value)
Sets the scaling type for the image.
|
void |
setSrc(java.lang.String value)
Sets the source of the image.
|
void |
setStyle(java.lang.String value)
Sets the value of the HTML "style" attribute.
|
void |
setTitle(java.lang.String value)
Sets the value of the HTML "title" attribute.
|
void |
setUsemap(java.lang.String value)
Sets the value of the HTML "usemap" attribute.
|
void |
setVspace(java.lang.String value)
Sets the value of the HTML "vspace" attribute.
|
void |
setWidth(java.lang.String value)
Sets the scaling width for the image.
|
doAfterBody, doInitBody, getBodyContent, getPreviousOut, setBodyContent
findAncestorWithClass, getParent, getValue, getValues, removeValue, setPageContext, setParent, setValue
public static CmsImageScaler getScaler(CmsImageScaler scaler, CmsImageScaler original, java.lang.String scaleParam)
scaler
- the scaler created from this tags parametersoriginal
- a scaler that contains the original image dimensionsscaleParam
- optional scaler parameters for croppingpublic static java.lang.String imageTagAction(java.lang.String src, CmsImageScaler scaler, java.util.Map<java.lang.String,java.lang.String> attributes, boolean partialTag, boolean noDim, javax.servlet.ServletRequest req) throws CmsException
src
- the image sourcescaler
- the image scaleing parametersattributes
- the additional image HTML attributespartialTag
- if true
, the opening <img
and closing />
is omittednoDim
- if true
, the height
and width
attributes are omittedreq
- the current requestCmsException
- in case something goes wrongpublic static java.lang.String imageTagAction(java.lang.String src, CmsImageScaler scaler, java.util.Map<java.lang.String,java.lang.String> attributes, boolean partialTag, javax.servlet.ServletRequest req) throws CmsException
src
- the image sourcescaler
- the image scaleing parametersattributes
- the additional image HTML attributespartialTag
- if true
, the opening <img
and closing />
is omittedreq
- the current requestCmsException
- in case something goes wrongpublic void addParameter(java.lang.String name, java.lang.String value)
I_CmsJspTagParamParent
addParameter
在接口中 I_CmsJspTagParamParent
name
- the name of the parametervalue
- the value of the parameterI_CmsJspTagParamParent.addParameter(java.lang.String, java.lang.String)
public int doEndTag() throws javax.servlet.jsp.JspException
doEndTag
在接口中 javax.servlet.jsp.tagext.Tag
doEndTag
在类中 javax.servlet.jsp.tagext.BodyTagSupport
javax.servlet.jsp.JspException
Tag.doEndTag()
public int doStartTag()
BodyTag.EVAL_BODY_BUFFERED
.doStartTag
在接口中 javax.servlet.jsp.tagext.Tag
doStartTag
在类中 javax.servlet.jsp.tagext.BodyTagSupport
BodyTag.EVAL_BODY_BUFFERED
Tag.doStartTag()
public java.lang.String getAlign()
public java.lang.String getAlt()
public java.lang.String getBorder()
public java.lang.String getCssclass()
public java.lang.String getHeight()
public java.lang.String getHspace()
public java.lang.String getId()
getId
在类中 javax.servlet.jsp.tagext.TagSupport
public java.lang.String getLongdesc()
public java.lang.String getMaxHeight()
public java.lang.String getMaxWidth()
public java.lang.String getName()
public java.lang.String getNoDim()
"true"
if the created HTML image tag does not contain height and width attributes."true"
if the created HTML image tag does not contain height and width attributespublic java.lang.String getScaleColor()
public java.lang.String getScaleFilter()
public java.lang.String getScalePosition()
public java.lang.String getScaleQuality()
public java.lang.String getScaleRendermode()
public java.lang.String getScaleType()
public java.lang.String getSrc()
public java.lang.String getStyle()
public java.lang.String getTitle()
public java.lang.String getUsemap()
public java.lang.String getVspace()
public java.lang.String getWidth()
public java.lang.String isPartialTag()
"true"
if the HTML tag should only be created as partial tag."true"
if the HTML tag should only be created as partial tagpublic void release()
release
在接口中 javax.servlet.jsp.tagext.Tag
release
在类中 javax.servlet.jsp.tagext.BodyTagSupport
Tag.release()
public void setAlign(java.lang.String value)
value
- the value of the HTML "align" attribute to setpublic void setAlt(java.lang.String value)
value
- the value of the HTML "alt" attribute to setpublic void setBorder(java.lang.String value)
value
- the value of the HTML "border" attribute to setpublic void setCssclass(java.lang.String value)
value
- the value of the HTML "class" attribute to setpublic void setHeight(java.lang.String value)
If no valid integer is given, then "0" is used as value.
value
- the scaling height for the image to setpublic void setHspace(java.lang.String value)
value
- the value of the HTML "hspace" attribute to setpublic void setId(java.lang.String value)
setId
在类中 javax.servlet.jsp.tagext.TagSupport
value
- the value of the HTML "id" attribute to setpublic void setLongdesc(java.lang.String value)
value
- the value of the HTML "longdesc" attribute to setpublic void setMaxHeight(java.lang.String value)
If no valid integer is given, then the value of getHeight()
is used as value.
value
- the maximum scaling height for the image to setpublic void setMaxWidth(java.lang.String value)
If no valid integer is given, then the value of getWidth()
is used as value.
value
- the maximum scaling width for the image to setpublic void setName(java.lang.String value)
value
- the value of the HTML "name" attribute to setpublic void setNoDim(java.lang.String noDim)
noDim
- the value to setpublic void setPartialTag(java.lang.String partialTag)
partialTag
- the value to setpublic void setScaleColor(java.lang.String value)
value
- the background color to setpublic void setScaleFilter(java.lang.String value)
value
- the filter(s) to setpublic void setScalePosition(java.lang.String value)
value
- the position to setpublic void setScaleQuality(java.lang.String value)
value
- the quality to setpublic void setScaleRendermode(java.lang.String value)
value
- the render mode to setpublic void setScaleType(java.lang.String value)
If no valid integer is given, then "0" is used as value.
value
- the scaling type for the image to setpublic void setSrc(java.lang.String value)
The source must be an absolute path in the current users OpenCms site, without any webapp or servlet prefix.
value
- the image source to setpublic void setStyle(java.lang.String value)
value
- the value of the HTML "style" attribute to setpublic void setTitle(java.lang.String value)
value
- the value of the HTML "title" attribute to setpublic void setUsemap(java.lang.String value)
value
- the value of the HTML "usemap" attribute to setpublic void setVspace(java.lang.String value)
value
- the value of the HTML "vspace" attribute to setpublic void setWidth(java.lang.String value)
If no valid integer is given, then "0" is used as value.
value
- the scaling width for the image to set