org.wicketstuff.minis.prototipbehaviour
Class PrototipSettings

java.lang.Object
  extended by org.wicketstuff.minis.prototipbehaviour.PrototipSettings
All Implemented Interfaces:
java.io.Serializable

public class PrototipSettings
extends java.lang.Object
implements java.io.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 Summary
PrototipSettings()
           
 
Method Summary
 boolean equals(java.lang.Object obj)
           
 java.lang.String getClassName()
           
 java.lang.String getCloseButton()
           
 java.lang.String getDelay()
           
 java.lang.String getDuration()
           
 java.lang.String getEffect()
           
 java.lang.String getExtraOptions()
           
 java.lang.String getFixed()
           
 java.lang.String getHideAfter()
           
 java.lang.String getHideOn()
           
 java.lang.String getHook()
           
 java.lang.String getOffset_x()
           
 java.lang.String getOffset_y()
           
 java.lang.String getOptionsString(java.lang.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
 java.lang.String getShowOn()
           
 java.lang.String getTarget()
           
 java.lang.String getTitle()
           
 java.lang.String getViewpoint()
           
 int hashCode()
           
 PrototipSettings setClassName(java.lang.String className)
          you do not need to include the ' '
 PrototipSettings setCloseButton(java.lang.String closeButton)
          either false or true
 PrototipSettings setDelay(java.lang.String delay)
          seconds before tooltip appears eg 0.2
 PrototipSettings setDuration(java.lang.String duration)
          duration of the effect, if used eg 0.3
 PrototipSettings setEffect(java.lang.String effect)
          you do not need to include the ' ' false, appear or blind, or others if they get enabled
 PrototipSettings setExtraOptions(java.lang.String extraOptions)
          Futureproofing - this allows you at add any string as an option (note you will need to take care of ' and { } yourself
 PrototipSettings setFixed(java.lang.String fixed)
          eg false or true
 PrototipSettings setHideAfter(java.lang.String hideAfter)
          false or a number eg 1.5
 PrototipSettings setHideOn(java.lang.String hideOn)
          any event eg mouseout or false
 PrototipSettings setHideOn(java.lang.String element, java.lang.String event)
          eg: { element: 'element|target|tip|closeButton|.close', event: 'click|mouseover|mousemove' }
 PrototipSettings setHook(java.lang.String target, java.lang.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()
 PrototipSettings setHookFalse()
           
 PrototipSettings setOffset_x(java.lang.String offset_x)
           
 PrototipSettings setOffset_y(java.lang.String offset_y)
           
 PrototipSettings setOffset(java.lang.String offset_x, java.lang.String offset_y)
          Set both x and y offsets
 PrototipSettings setShowOn(java.lang.String showOn)
           
 PrototipSettings setTarget(java.lang.String target)
           
 PrototipSettings setTitle(java.lang.String title)
           
 PrototipSettings setViewpoint(java.lang.String viewpoint)
           
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

PrototipSettings

public PrototipSettings()
Method Detail

getOptionsString

public java.lang.String getOptionsString(java.lang.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 java.lang.String getClassName()
Returns:
the className

setClassName

public PrototipSettings setClassName(java.lang.String className)
you do not need to include the ' '

Parameters:
className - the className to set
Returns:
this

getCloseButton

public java.lang.String getCloseButton()
Returns:
the closeButton

setCloseButton

public PrototipSettings setCloseButton(java.lang.String closeButton)
either false or true

Parameters:
closeButton - the closeButton to set
Returns:
this

getDuration

public java.lang.String getDuration()
Returns:
the duration

setDuration

public PrototipSettings setDuration(java.lang.String duration)
duration of the effect, if used eg 0.3

Parameters:
duration - the duration to set
Returns:
this

getFixed

public java.lang.String getFixed()
Returns:
the fixed

setFixed

public PrototipSettings setFixed(java.lang.String fixed)
eg false or true

Parameters:
fixed - the fixed to set
Returns:
this

getDelay

public java.lang.String getDelay()
Returns:
the delay

setDelay

public PrototipSettings setDelay(java.lang.String delay)
seconds before tooltip appears eg 0.2

Parameters:
delay - the delay to set
Returns:
this

getEffect

public java.lang.String getEffect()
Returns:
the effect

setEffect

public PrototipSettings setEffect(java.lang.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 java.lang.String getHideAfter()
Returns:
the hideAfter

setHideAfter

public PrototipSettings setHideAfter(java.lang.String hideAfter)
false or a number eg 1.5

Parameters:
hideAfter - the hideAfter to set
Returns:
this

getHideOn

public java.lang.String getHideOn()
Returns:
the hideOn

setHideOn

public PrototipSettings setHideOn(java.lang.String hideOn)
any event eg mouseout or false

Parameters:
hideOn - the hideOn to set
Returns:
this

setHideOn

public PrototipSettings setHideOn(java.lang.String element,
                                  java.lang.String event)
eg: { element: 'element|target|tip|closeButton|.close', event: 'click|mouseover|mousemove' }

Parameters:
element -
event -
Returns:
this

getHook

public java.lang.String getHook()
Returns:
the hook

setHookFalse

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

setHook

public PrototipSettings setHook(java.lang.String target,
                                java.lang.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 java.lang.String getOffset_x()
Returns:
the offset_x

setOffset_x

public PrototipSettings setOffset_x(java.lang.String offset_x)
Parameters:
offset_x - the offset_x to set
Returns:
this

getOffset_y

public java.lang.String getOffset_y()
Returns:
the offset_y

setOffset_y

public PrototipSettings setOffset_y(java.lang.String offset_y)
Parameters:
offset_y - the offset_y to set
Returns:
this

setOffset

public PrototipSettings setOffset(java.lang.String offset_x,
                                  java.lang.String offset_y)
Set both x and y offsets

Parameters:
offset_x -
offset_y -
Returns:
this

getShowOn

public java.lang.String getShowOn()
Returns:
the showOn

setShowOn

public PrototipSettings setShowOn(java.lang.String showOn)
Parameters:
showOn - the showOn to set
Returns:
this

getTarget

public java.lang.String getTarget()
Returns:
the target

setTarget

public PrototipSettings setTarget(java.lang.String target)
Parameters:
target - the target to set
Returns:
this

getTitle

public java.lang.String getTitle()
Returns:
the title

setTitle

public PrototipSettings setTitle(java.lang.String title)
Parameters:
title - the title to set

getViewpoint

public java.lang.String getViewpoint()
Returns:
the viewpoint

setViewpoint

public PrototipSettings setViewpoint(java.lang.String viewpoint)
Parameters:
viewpoint - the viewpoint to set
Returns:
this

getExtraOptions

public java.lang.String getExtraOptions()
Returns:
the extraOptions

setExtraOptions

public PrototipSettings setExtraOptions(java.lang.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 java.lang.Object

equals

public boolean equals(java.lang.Object obj)
Overrides:
equals in class java.lang.Object


Copyright © 2010. All Rights Reserved.