Class TooltipTag

  • All Implemented Interfaces:
    JcmsConstants, JaliosConstants, java.io.Serializable, javax.servlet.jsp.tagext.BodyTag, javax.servlet.jsp.tagext.IterationTag, javax.servlet.jsp.tagext.JspTag, javax.servlet.jsp.tagext.Tag

    public class TooltipTag
    extends javax.servlet.jsp.tagext.BodyTagSupport
    implements JcmsConstants
    This tag prints a small tooltip icons that displays inline or ajax content
    Version:
    $Revision: 119523 $
    Author:
    Jean-Philippe Encausse
    See Also:
    Serialized Form
    • Field Detail

      • TOOLTIP_CLASS_INLINE

        public static final java.lang.String TOOLTIP_CLASS_INLINE
        See Also:
        Constant Field Values
      • bodyText

        protected java.lang.String bodyText
      • property

        protected java.lang.String property
      • glpParams

        protected java.lang.String[] glpParams
      • longdesc

        protected java.lang.String longdesc
      • icon

        protected java.lang.String icon
      • sprite

        protected java.lang.String sprite
    • Constructor Detail

      • TooltipTag

        public TooltipTag()
    • Method Detail

      • doAfterBody

        public int doAfterBody()
                        throws javax.servlet.jsp.JspException
        Specified by:
        doAfterBody in interface javax.servlet.jsp.tagext.IterationTag
        Overrides:
        doAfterBody in class javax.servlet.jsp.tagext.BodyTagSupport
        Throws:
        javax.servlet.jsp.JspException
      • doEndTag

        public int doEndTag()
                     throws javax.servlet.jsp.JspException
        Specified by:
        doEndTag in interface javax.servlet.jsp.tagext.Tag
        Overrides:
        doEndTag in class javax.servlet.jsp.tagext.BodyTagSupport
        Throws:
        javax.servlet.jsp.JspException
      • clean

        protected void clean()
      • getLongdescProperty

        public static java.lang.String getLongdescProperty​(java.lang.String ttGlp,
                                                           java.lang.String[] ttParams,
                                                           boolean wrap)
        Convenient method use to generate longdesc tooltip property on an HTML tag. The HTML element should use css class TOOLTIP_CLASS.
        Parameters:
        ttGlp - the jcms property
        ttParams - the property's params
        wrap - boolean true if the result should be wrap in a longdesc attribute
        Returns:
        String longdesc computed value for given property
      • getTooltipForProperty

        public static java.lang.String getTooltipForProperty​(java.lang.String ttGlp,
                                                             java.lang.String[] ttParams)
        Convenient method use to generate tooltip IMG tag for a given property.
        Parameters:
        ttGlp - the jcms property
        ttParams - the property's params
        Returns:
        String html tag computed for given property
      • getTooltipForProperty

        public static java.lang.String getTooltipForProperty​(java.lang.String ttGlp,
                                                             java.lang.String[] ttParams,
                                                             java.lang.String ttIcon,
                                                             java.lang.String ttClass)
        Convenient method use to generate tooltip IMG tag for a given property.
        Parameters:
        ttGlp - the jcms property
        ttParams - the property's params
        ttIcon - a custom icon
        ttClass - a tooltip class
        Returns:
        String html tag computed for given property
      • getTooltipForText

        public static java.lang.String getTooltipForText​(java.lang.String ttBody)
        Convenient method use to generate tooltip IMG tag for a given body text.
        Parameters:
        ttBody - the inline body text
        Returns:
        String html tag computed for given property
      • getTooltipForText

        public static java.lang.String getTooltipForText​(java.lang.String ttBody,
                                                         java.lang.String ttIcon)
        Convenient method use to generate tooltip IMG tag for a given body text.
        Parameters:
        ttBody - the inline body text
        ttIcon - a custom icon
        Returns:
        String html tag computed for given property
      • getTooltipForLongdesc

        public static java.lang.String getTooltipForLongdesc​(java.lang.String ttLongdesc)
        Convenient method use to generate tooltip IMG tag for a given longdesc.
        Parameters:
        ttLongdesc - the longdesc
        Returns:
        String html tag computed for given property
      • getTooltipForLongdesc

        public static java.lang.String getTooltipForLongdesc​(java.lang.String ttLongdesc,
                                                             java.lang.String ttIcon)
        Convenient method use to generate tooltip IMG tag for a given longdesc.
        Parameters:
        ttLongdesc - the longdesc
        ttIcon - a custom icon
        Returns:
        String html tag computed for given property
      • getTooltipForTitle

        public static java.lang.String getTooltipForTitle​(java.lang.String ttTitle)
        Convenient method use to generate tooltip IMG tag for a given title.
        Parameters:
        ttTitle - the title
        Returns:
        String html tag computed for given property
      • getTooltipForTitle

        public static java.lang.String getTooltipForTitle​(java.lang.String ttTitle,
                                                          java.lang.String ttIcon)
        Convenient method use to generate tooltip IMG tag for a given title.
        Parameters:
        ttTitle - the title
        ttIcon - a custom icon
        Returns:
        String html tag computed for given property
      • getTooltipForTitle

        public static java.lang.String getTooltipForTitle​(java.lang.String ttTitle,
                                                          java.lang.String ttIcon,
                                                          java.lang.String ttClass)
        Convenient method use to generate tooltip IMG tag for a given title.
        Parameters:
        ttTitle - the title
        ttIcon - a custom icon
        ttClass - a toltip class
        Returns:
        String html tag computed for given property
      • getBodyText

        public java.lang.String getBodyText()
        Returns the value previously sets
        Returns:
        String body text
      • setBodyText

        public void setBodyText​(java.lang.String bodyText)
        Set the value used to fill tooltip content using inline DOM.
        Parameters:
        bodyText - String body text
      • getProperty

        public java.lang.String getProperty()
        Returns the value of the property previously sets
        Returns:
        String property
      • setProperty

        public void setProperty​(java.lang.String property)
        Set the value of the property used to fill tooltip content using AJAX request on dedicated longdesc uri.
        Parameters:
        property - String property
      • getParams

        public java.lang.String[] getParams()
        Returns the value of the parameters associated with the given property
        Returns:
        String[] params
      • setParams

        public void setParams​(java.lang.String[] pparams)
        Set the associated parameters of a given property
        Parameters:
        pparams - String[] of parameters
      • getLongdesc

        public java.lang.String getLongdesc()
        Returns the value of the longdesc attribute previously sets
        Returns:
        String longdesc
      • setLongdesc

        public void setLongdesc​(java.lang.String longdesc)
        Set the value of the longdesc attribute used to fill tooltip content using AJAX request.
        Parameters:
        longdesc - String longdesc
      • getIcon

        public java.lang.String getIcon()
        Returns the value of the icon attribute previously sets
        Returns:
        String icon uri
      • setIcon

        public void setIcon​(java.lang.String icon)
        Set the value of the icon attribute used to display tooltip.
        Parameters:
        icon - String icon uri
      • getSprite

        public java.lang.String getSprite()
        Returns the value of the sprite attribute previously sets
        Returns:
        String sprite value
      • setSprite

        public void setSprite​(java.lang.String sprite)
        Set the value of the sprite attribute used to display tooltip.
        Parameters:
        sprite - String sprite value