Class LegendTag

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

public class LegendTag extends jakarta.servlet.jsp.tagext.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:
  • Field Summary

    Fields inherited from class jakarta.servlet.jsp.tagext.TagSupport

    id, pageContext

    Fields inherited from interface jakarta.servlet.jsp.tagext.IterationTag

    EVAL_BODY_AGAIN

    Fields inherited from interface jakarta.servlet.jsp.tagext.Tag

    EVAL_BODY_INCLUDE, EVAL_PAGE, SKIP_BODY, SKIP_PAGE
  • Constructor Summary

    Constructors
    Constructor
    Description
     
  • Method Summary

    Modifier and Type
    Method
    Description
    int
    Renders the legend table to the JSP output stream.
    void
    Resets the tag's state variables.
    void
    Sets the CSS class names for each legend entry table cell.
    void
    Sets the CSS class name for the legend text.
    void
    setLabels(String labels)
    Sets the labels for each legend entry.
    void
    setWidth(int width)
    Sets the width of each legend table entry.

    Methods inherited from class jakarta.servlet.jsp.tagext.TagSupport

    doAfterBody, doEndTag, 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
  • 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 jakarta.servlet.jsp.tagext.Tag
      Overrides:
      release in class jakarta.servlet.jsp.tagext.TagSupport
    • doStartTag

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