Class PrototipBehaviour

    • Field Detail

      • tooltip

        protected String tooltip
      • tooltipComponent

        protected Component tooltipComponent
      • overrideHeaderContributor

        protected boolean overrideHeaderContributor
      • title

        protected String title
      • onLoad

        protected boolean onLoad
      • selectedJsType

        protected static JS_TYPE selectedJsType
        Made this static as it is very unlikely that you would want different versions of prototip.js across your site
    • Constructor Detail

      • PrototipBehaviour

        public PrototipBehaviour()
        Default constructor If you use this then you must set either a string, or a component manually
      • PrototipBehaviour

        public PrototipBehaviour​(String tooltip)
        Provide a simple string as a tooltip
        Parameters:
        tooltip -
      • PrototipBehaviour

        public PrototipBehaviour​(Component panel)
        Provide a component to show as the tool tip (eg a panel)
        Parameters:
        panel -
    • Method Detail

      • bind

        public void bind​(Component component)
        override bind so that the component you add this behavior to becomes the component the tooltip applies to
        Overrides:
        bind in class Behavior
      • remove

        public void remove​(AjaxRequestTarget target)
        Given an ajax request target, remove this tip from the page
        Parameters:
        target -
      • hide

        public void hide​(AjaxRequestTarget target)
        Given an ajax request target, hide this tip on the page
        Parameters:
        target -
      • toJavascript

        protected String toJavascript()
        Get string to add the prototip to the page
        Returns:
        the String
      • getSource

        public Component getSource()
        Returns:
        the source
      • setSource

        public PrototipBehaviour setSource​(Component source)
        Parameters:
        source - the source to set
        Returns:
        this object
      • getTooltip

        public String getTooltip()
        Returns:
        the tooltip
      • setTooltip

        public PrototipBehaviour setTooltip​(String tooltip)
        Parameters:
        tooltip - the tooltip to set
        Returns:
        this object
      • getTooltipComponent

        public Component getTooltipComponent()
        Returns:
        the tooltip component
      • setTooltipComponent

        public PrototipBehaviour setTooltipComponent​(Component tooltipComponent)
        Parameters:
        panel - the panel to set
        Returns:
        this object
      • isOverrideHeaderContributor

        public boolean isOverrideHeaderContributor()
        Returns:
        the overrideHeaderContributor
      • setOverrideHeaderContributor

        public PrototipBehaviour setOverrideHeaderContributor​(boolean overrideHeaderContributor)
        If you do not want this behavour to add the required javascript and css files to the header set this to true (default false)
        Parameters:
        overrideHeaderContributor - the overrideHeaderContributor to set
        Returns:
        this object
      • getTitle

        public String getTitle()
        Returns:
        the title
      • setTitle

        public PrototipBehaviour setTitle​(String title)
        Parameters:
        title - the title to set
        Returns:
        this object
      • getSelectedJsType

        public static JS_TYPE getSelectedJsType()
        Returns:
        the selectedJsType
      • setSelectedJsType

        public static void setSelectedJsType​(JS_TYPE selectedJsType)
        There are 3 different js files which can be included: a normal uncompressed one a minified one a minified and gziped one To override the default (the minified one) set this parameter This is a static method and as such affects all PrototipBehaviour in the system, this is so that you do not have to set the type for every PrototipBehaviour that you use (which is tedious)
        Parameters:
        selectedJsType - the selectedJsType to set
      • isOnLoad

        public boolean isOnLoad()
        Is the javascript set to load 'onload' if false then it will be 'ondomready'
        Returns:
      • setOnLoad

        public void setOnLoad​(boolean onLoad)
        Is the javascript set to load 'onload' if false then it will be 'ondomready'
        Parameters:
        onLoad -