Class PrototipSettings

  • All Implemented Interfaces:
    Serializable

    public class PrototipSettings
    extends Object
    implements Serializable
    This is a class for creating settings to be used with the prototip lib (the optional third argument) in all cases you do not need to worry about enclosing your strings in ' ' There is logic in place so that if you enter false or true (ie the boolean), or a number it will not enclose your string in '', where as any other string it will see http://www.nickstakenburg.com/projects/prototip/ for a better description of the options that prototip uses
    Author:
    Richard Wilkinson
    See Also:
    Serialized Form
    • Constructor Detail

      • PrototipSettings

        public PrototipSettings()
    • Method Detail

      • getOptionsString

        public String getOptionsString​(String title)
        Generates the correct Javascript code to add as the third parameter to a prototip tooltip any title passed in here will override any title which is set in this object eg: PrototipBehaviour title > PrototipSettings title
        Returns:
        Javascript String
      • getClassName

        public String getClassName()
        Returns:
        the className
      • setClassName

        public PrototipSettings setClassName​(String className)
        you do not need to include the ' '
        Parameters:
        className - the className to set
        Returns:
        this
      • getCloseButton

        public String getCloseButton()
        Returns:
        the closeButton
      • setCloseButton

        public PrototipSettings setCloseButton​(String closeButton)
        either false or true
        Parameters:
        closeButton - the closeButton to set
        Returns:
        this
      • getDuration

        public String getDuration()
        Returns:
        the duration
      • setDuration

        public PrototipSettings setDuration​(String duration)
        duration of the effect, if used eg 0.3
        Parameters:
        duration - the duration to set
        Returns:
        this
      • getFixed

        public String getFixed()
        Returns:
        the fixed
      • setFixed

        public PrototipSettings setFixed​(String fixed)
        eg false or true
        Parameters:
        fixed - the fixed to set
        Returns:
        this
      • getDelay

        public String getDelay()
        Returns:
        the delay
      • setDelay

        public PrototipSettings setDelay​(String delay)
        seconds before tooltip appears eg 0.2
        Parameters:
        delay - the delay to set
        Returns:
        this
      • getEffect

        public String getEffect()
        Returns:
        the effect
      • setEffect

        public PrototipSettings setEffect​(String effect)
        you do not need to include the ' ' false, appear or blind, or others if they get enabled
        Parameters:
        effect - the effect to set
        Returns:
        this
      • getHideAfter

        public String getHideAfter()
        Returns:
        the hideAfter
      • setHideAfter

        public PrototipSettings setHideAfter​(String hideAfter)
        false or a number eg 1.5
        Parameters:
        hideAfter - the hideAfter to set
        Returns:
        this
      • getHideOn

        public String getHideOn()
        Returns:
        the hideOn
      • setHideOn

        public PrototipSettings setHideOn​(String hideOn)
        any event eg mouseout or false
        Parameters:
        hideOn - the hideOn to set
        Returns:
        this
      • setHideOn

        public PrototipSettings setHideOn​(String element,
                                          String event)
        eg: { element: 'element|target|tip|closeButton|.close', event: 'click|mouseover|mousemove' }
        Parameters:
        element -
        event -
        Returns:
        this
      • getHook

        public String getHook()
        Returns:
        the hook
      • setHookFalse

        public PrototipSettings setHookFalse()
        Parameters:
        hook - the hook to set
        Returns:
        this
      • setHook

        public PrototipSettings setHook​(String target,
                                        String tip)
        Set the hook, where you want eg: { target: 'topLeft|topRight|bottomLeft|bottomRight| topMiddle|bottomMiddle|leftMiddle|rightMiddle', tip: 'topLeft|topRight|bottomLeft|bottomRight| topMiddle|bottomMiddle|leftMiddle|rightMiddle' } for false use setHookFalse()
        Parameters:
        target -
        tip -
        Returns:
        this
      • getOffset_x

        public String getOffset_x()
        Returns:
        the offset_x
      • setOffset_x

        public PrototipSettings setOffset_x​(String offset_x)
        Parameters:
        offset_x - the offset_x to set
        Returns:
        this
      • getOffset_y

        public String getOffset_y()
        Returns:
        the offset_y
      • setOffset_y

        public PrototipSettings setOffset_y​(String offset_y)
        Parameters:
        offset_y - the offset_y to set
        Returns:
        this
      • setOffset

        public PrototipSettings setOffset​(String offset_x,
                                          String offset_y)
        Set both x and y offsets
        Parameters:
        offset_x -
        offset_y -
        Returns:
        this
      • getShowOn

        public String getShowOn()
        Returns:
        the showOn
      • setShowOn

        public PrototipSettings setShowOn​(String showOn)
        Parameters:
        showOn - the showOn to set
        Returns:
        this
      • getTarget

        public String getTarget()
        Returns:
        the target
      • setTarget

        public PrototipSettings setTarget​(String target)
        Parameters:
        target - the target to set
        Returns:
        this
      • getTitle

        public String getTitle()
        Returns:
        the title
      • getViewpoint

        public String getViewpoint()
        Returns:
        the viewpoint
      • setViewpoint

        public PrototipSettings setViewpoint​(String viewpoint)
        Parameters:
        viewpoint - the viewpoint to set
        Returns:
        this
      • getExtraOptions

        public String getExtraOptions()
        Returns:
        the extraOptions
      • setExtraOptions

        public PrototipSettings setExtraOptions​(String extraOptions)
        Futureproofing - this allows you at add any string as an option (note you will need to take care of ' and { } yourself
        Parameters:
        extraOptions - the extraOptions to set
        Returns:
        this
      • hashCode

        public int hashCode()
        Overrides:
        hashCode in class Object