Class LegendTag
java.lang.Object
javax.servlet.jsp.tagext.TagSupport
org.deltava.taglib.view.LegendTag
- All Implemented Interfaces:
Serializable
,IterationTag
,JspTag
,Tag
A JSP Tag to display view row color legends. These are rendered as a single row HTML table, and the class
names used for each row entry are used to set the background colors for each legend entry.
- Since:
- 1.0
- Version:
- 7.0
- Author:
- Luke
- See Also:
-
Field Summary
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
Constructors -
Method Summary
Modifier and TypeMethodDescriptionint
Renders the legend table to the JSP output stream.void
release()
Resets the tag's state variables.void
setClasses
(String cNames) Sets the CSS class names for each legend entry table cell.void
setClassName
(String cName) Sets the CSS class name for the legend text.void
Sets the labels for each legend entry.void
setWidth
(int width) Sets the width of each legend table entry.Methods inherited from class javax.servlet.jsp.tagext.TagSupport
doAfterBody, doEndTag, findAncestorWithClass, getId, getParent, getValue, getValues, removeValue, setId, setPageContext, setParent, setValue
-
Constructor Details
-
LegendTag
public LegendTag()
-
-
Method Details
-
setClassName
Sets the CSS class name for the legend text.- Parameters:
cName
- the CSS class name
-
setWidth
public void setWidth(int width) Sets the width of each legend table entry.- Parameters:
width
- the width in pixels or percent
-
setLabels
Sets the labels for each legend entry. Each label will be trimmed using theString.trim()
method, so use a space for an empty label.- Parameters:
labels
- the comma-delimited list of labels
-
setClasses
Sets the CSS class names for each legend entry table cell. Each class name will be trimmed using theString.trim()
method, so use a space for an empty class name.- Parameters:
cNames
- the comma-delimited list of CSS class names
-
release
public void release()Resets the tag's state variables.- Specified by:
release
in interfaceTag
- Overrides:
release
in classTagSupport
-
doStartTag
Renders the legend table to the JSP output stream.- Specified by:
doStartTag
in interfaceTag
- Overrides:
doStartTag
in classTagSupport
- Returns:
- TagSupport.SKIP_BODY
- Throws:
JspException
- if an I/O error occurs, or the number of classNames != the number of labels
-