Class LegendTag

java.lang.Object
javax.servlet.jsp.tagext.TagSupport
org.deltava.taglib.view.LegendTag
All Implemented Interfaces:
Serializable, IterationTag, JspTag, Tag

public class LegendTag extends TagSupport
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:
  • Constructor Details

    • LegendTag

      public LegendTag()
  • Method Details

    • setClassName

      public void setClassName(String cName)
      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

      public void setLabels(String labels)
      Sets the labels for each legend entry. Each label will be trimmed using the String.trim() method, so use a space for an empty label.
      Parameters:
      labels - the comma-delimited list of labels
    • setClasses

      public void setClasses(String cNames)
      Sets the CSS class names for each legend entry table cell. Each class name will be trimmed using the String.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 interface Tag
      Overrides:
      release in class TagSupport
    • doStartTag

      public int doStartTag() throws JspException
      Renders the legend table to the JSP output stream.
      Specified by:
      doStartTag in interface Tag
      Overrides:
      doStartTag in class TagSupport
      Returns:
      TagSupport.SKIP_BODY
      Throws:
      JspException - if an I/O error occurs, or the number of classNames != the number of labels