WalterZornTips (jWicket: jQuery Wicket integration - toolstips.walterzorn 1.4.11 API)

org.wicketstuff.jwicket.tooltip
Class WalterZornTips

java.lang.Object
  extended by org.apache.wicket.behavior.AbstractBehavior
      extended by org.apache.wicket.behavior.AbstractHeaderContributor
          extended by org.wicketstuff.jwicket.tooltip.AbstractToolTip
              extended by org.wicketstuff.jwicket.tooltip.WalterZornTips
All Implemented Interfaces:
java.io.Serializable, org.apache.wicket.behavior.IBehavior, org.apache.wicket.IClusterable, org.apache.wicket.markup.html.IHeaderContributor

public class WalterZornTips
extends org.wicketstuff.jwicket.tooltip.AbstractToolTip

This class is a wrapper around Walter Zorn's ToolTip library. The implementation covers version 5.31 together with jQuery 1.3.2. For a detailed description of options, CSS styling and other thins have a look at the original documentation.

See Also:
Serialized Form

Field Summary
static org.wicketstuff.jwicket.JQueryJavascriptResourceReference walterzorn
           
 
Constructor Summary
WalterZornTips(java.lang.String tooltipText)
           
 
Method Summary
 void disable(org.apache.wicket.ajax.AjaxRequestTarget target)
           
 void enable(org.apache.wicket.ajax.AjaxRequestTarget target)
           
 void onComponentTag(org.apache.wicket.Component component, org.apache.wicket.markup.ComponentTag tag)
           
 WalterZornTips setAbove(boolean value)
          Places the tooltip above the mouse symbol.
 WalterZornTips setBgColor(java.lang.String color)
          Sets the background color of the tooltip box.
 WalterZornTips setBgImg(java.lang.String image)
          Sets the background image of the tooltip box.
 WalterZornTips setBorderColor(java.lang.String color)
          Sets the color of the tooltip box border.
 WalterZornTips setBorderStyle(java.lang.String style)
          Sets the CSS style of the tooltip box border.
 WalterZornTips setBorderWidth(int width)
          Sets the width of the tooltip box border in px.
 WalterZornTips setCentermouse(boolean value)
          Center the tooltip horizontally relating to the mouse pointer
 WalterZornTips setClickclose(boolean value)
          Should a mouseklick close the tooltip?
 WalterZornTips setClicksticky(boolean value)
          Enables the user to fixate the tooltip, by just clicking onto the HTML element (e.g.
 WalterZornTips setCloseButton(boolean value)
          Should a close button be displayed inside the tooltip box
 WalterZornTips setCloseButtonColors(java.lang.String background, java.lang.String text, java.lang.String highlighted, java.lang.String highlightedText)
          Set the colors used for the closebutton.
 WalterZornTips setCloseButtonText(java.lang.String text)
          Sets the text displayed in a close button
 WalterZornTips setDelay(int ms)
          Sets the delay in ms after the tolltip shows up
 WalterZornTips setDuration(int ms)
          Sets the time in ms until the tolltip is hidden
 WalterZornTips setExclusive(boolean value)
          The active tooltip stays open until it is closed activly.
 WalterZornTips setFadein(int ms)
          The tooltip is not showed immediately.
 WalterZornTips setFadeout(int ms)
          The tooltip is not hidden immediately.
 WalterZornTips setFix1(int x, int y)
          Displays the tooltip at fixed position x and y
 WalterZornTips setFix2(java.lang.String id, int x, int y)
          Displays the tooltip at a position relative to another HTML element
 WalterZornTips setFollowmouse(boolean value)
          The tooltip follows the movement of the mouse.
 WalterZornTips setFontcolor(java.lang.String fontcolor)
          Sets the font color of the tooltip's content
 WalterZornTips setFontface(java.lang.String fontface)
          Sets the font face of the tooltip's content
 WalterZornTips setFontsize(int px)
          Sets the font size of the tooltip's content
 WalterZornTips setFontweight(java.lang.String fontweight)
          Sets the font weight of the tooltip's content
 WalterZornTips setHeight(int px)
          Sets the height of the tooltip in px
 WalterZornTips setJumphorz(boolean value)
          See the original documentation
 WalterZornTips setJumpvert(boolean value)
          See the original documentation
 WalterZornTips setLeft(boolean value)
          Positions the tooltip to the left ot the mouse pointer
 WalterZornTips setOffsetX(int px)
          Sets the x-offset from the mouse pointer
 WalterZornTips setOffsetY(int px)
          Sets the y-offset from the mouse pointer
 WalterZornTips setOpacity(int value)
          Sets the opacity of the tooltip content
 WalterZornTips setPadding(int px)
          Sets the padding between the tooltip border and the contents.
 WalterZornTips setRawOptions(java.lang.String options)
          You can use this method to set special options not covered by other methods.
 WalterZornTips setShadow(boolean value)
          Should the tooltip box drop a shadow
 WalterZornTips setShadowColor(java.lang.String color)
          Sets the color of the tooltip's shadow
 WalterZornTips setShadowWidth(int px)
          Sets the width of the tooltip shadow in px
 WalterZornTips setSticky(boolean value)
          Should the tooltip stay fixed at it's initial position
 WalterZornTips setTextalign(java.lang.String align)
          Sets the alignment of the tooltip's text
 WalterZornTips setTitle(java.lang.String title)
          Sets the title of te tooltip
 WalterZornTips setTitleAlign(java.lang.String align)
          Sets the alignment of the title
 WalterZornTips setTitleBgColor(java.lang.String color)
          Sets the background color of the title
 WalterZornTips setTitleFontColor(java.lang.String color)
          Sets the text color of the title
 WalterZornTips setTitleFontFace(java.lang.String fontface)
          Sets the fontface color of the title
 WalterZornTips setTitleFontSize(int px)
          Sets the fontsize of the title
 WalterZornTips setTitlePadding(int px)
          Sets the padding around the title
 WalterZornTips setTooltipText(java.lang.String htmlCode)
          Set the content of the ToolTip.
 WalterZornTips setTooltipTextWithCorrections(java.lang.String htmlCode)
          Set the content of the ToolTip.
 WalterZornTips setWidth(int px)
          Sets the width of the tooltip's box
 
Methods inherited from class org.wicketstuff.jwicket.tooltip.AbstractToolTip
bind, getHeaderContributors, update
 
Methods inherited from class org.apache.wicket.behavior.AbstractHeaderContributor
renderHead
 
Methods inherited from class org.apache.wicket.behavior.AbstractBehavior
afterRender, beforeRender, cleanup, detach, detachModel, exception, getStatelessHint, isEnabled, isTemporary, onException, onRendered, rendered
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

walterzorn

public static final org.wicketstuff.jwicket.JQueryJavascriptResourceReference walterzorn
Constructor Detail

WalterZornTips

public WalterZornTips(java.lang.String tooltipText)
Method Detail

enable

public void enable(org.apache.wicket.ajax.AjaxRequestTarget target)

disable

public void disable(org.apache.wicket.ajax.AjaxRequestTarget target)

onComponentTag

public void onComponentTag(org.apache.wicket.Component component,
                           org.apache.wicket.markup.ComponentTag tag)
Specified by:
onComponentTag in interface org.apache.wicket.behavior.IBehavior
Overrides:
onComponentTag in class org.apache.wicket.behavior.AbstractBehavior

setTooltipText

public WalterZornTips setTooltipText(java.lang.String htmlCode)
Set the content of the ToolTip. You can provide a simple text or complex HTML code.

Overrides:
setTooltipText in class org.wicketstuff.jwicket.tooltip.AbstractToolTip
Parameters:
htmlCode - the content

setTooltipTextWithCorrections

public WalterZornTips setTooltipTextWithCorrections(java.lang.String htmlCode)
Set the content of the ToolTip. You can provide a simple text or complex HTML code. The htmlCode gets modified:
originalreplaced by
""
'\'
No html code parsing is done, just a plain replacement. If you have special cases where the replacement leads to the wrong result, use setTooltipText(String) instead and be sure to pass correct html code to this method.

Parameters:
htmlCode - the content

setRawOptions

public WalterZornTips setRawOptions(java.lang.String options)
You can use this method to set special options not covered by other methods. The options must not start or end with "{" and "}".

Parameters:
options - the special options, e.g. "ABOVE, true, BGCOLOR, ''"
Returns:
this object

setAbove

public WalterZornTips setAbove(boolean value)
Places the tooltip above the mouse symbol.

Parameters:
value - true for above or false for below;
Returns:
this object

setBgColor

public WalterZornTips setBgColor(java.lang.String color)
Sets the background color of the tooltip box.

Parameters:
color - the color in CSS form e.g. #123456 or null to revert to the default value
Returns:
this object

setBgImg

public WalterZornTips setBgImg(java.lang.String image)
Sets the background image of the tooltip box.

Parameters:
image - a path to an image file e.g. /images/my-image.png or null to revert to the default value
Returns:
this object

setBorderColor

public WalterZornTips setBorderColor(java.lang.String color)
Sets the color of the tooltip box border.

Parameters:
color - the color in CSS form e.g. #123456 or null to revert to the default value
Returns:
this object

setBorderStyle

public WalterZornTips setBorderStyle(java.lang.String style)
Sets the CSS style of the tooltip box border.

Parameters:
style - the style of the border e.g. solid or null to revert to the default value
Returns:
this object

setBorderWidth

public WalterZornTips setBorderWidth(int width)
Sets the width of the tooltip box border in px.

Parameters:
width - the width of the border in px or a value less than 0 to revert to the default value
Returns:
this object

setCentermouse

public WalterZornTips setCentermouse(boolean value)
Center the tooltip horizontally relating to the mouse pointer

Parameters:
value - true for above or false for below;
Returns:
this object

setClickclose

public WalterZornTips setClickclose(boolean value)
Should a mouseklick close the tooltip?

Parameters:
value - true for closing by clicking or false for below;
Returns:
this object

setClicksticky

public WalterZornTips setClicksticky(boolean value)
Enables the user to fixate the tooltip, by just clicking onto the HTML element (e.g. link) that triggered the tooltip. This might help the user to read the tooltip more conveniently. Value: true, false.

Parameters:
value - true for enabling or false for disabling;
Returns:
this object

setCloseButton

public WalterZornTips setCloseButton(boolean value)
Should a close button be displayed inside the tooltip box

Parameters:
value - true for enabling or false for disabling;
Returns:
this object

setCloseButtonColors

public WalterZornTips setCloseButtonColors(java.lang.String background,
                                           java.lang.String text,
                                           java.lang.String highlighted,
                                           java.lang.String highlightedText)
Set the colors used for the closebutton. If one of thecolors is null then a default value is used.

Parameters:
background - the background color in CSS form e.g. #123456 or null for the default value
text - the text color in CSS form e.g. #123456 or null for the default value
highlighted - the color when the button is hovered in CSS form e.g. #123456 or null for the default value
highlightedText - the text color when the button is hovered in CSS form e.g. #123456 or null for the default value
Returns:
this object

setCloseButtonText

public WalterZornTips setCloseButtonText(java.lang.String text)
Sets the text displayed in a close button

Parameters:
text - the text or null to revert to the default value
Returns:
this object

setDelay

public WalterZornTips setDelay(int ms)
Sets the delay in ms after the tolltip shows up

Parameters:
ms - the delay or a value less than 0 to revert to the default value
Returns:
this object

setDuration

public WalterZornTips setDuration(int ms)
Sets the time in ms until the tolltip is hidden

Parameters:
ms - the time or a value less than 0 to revert to the default value
Returns:
this object

setExclusive

public WalterZornTips setExclusive(boolean value)
The active tooltip stays open until it is closed activly. Not other tooltip is diplayed until then.

Parameters:
value - true for enabling or false for disabling;
Returns:
this object

setFadein

public WalterZornTips setFadein(int ms)
The tooltip is not showed immediately. The appearance is animated and faded in during the given period.

Parameters:
ms - the time or a value less than 0 to revert to the default value
Returns:
this object

setFadeout

public WalterZornTips setFadeout(int ms)
The tooltip is not hidden immediately. The disappearance is animated and faded out during the given period.

Parameters:
ms - the time or a value less than 0 to revert to the default value
Returns:
this object

setFix1

public WalterZornTips setFix1(int x,
                              int y)
Displays the tooltip at fixed position x and y

Parameters:
x - the horizontal offset from page left border or a value less than 0 to revert to the default value
y - the vertical offset from page top border or a value less than 0 to revert to the default value
Returns:
this object

setFix2

public WalterZornTips setFix2(java.lang.String id,
                              int x,
                              int y)
Displays the tooltip at a position relative to another HTML element

Parameters:
id - the id of the HTML element
x - the horizontal offset from the given HTML element or a value less than 0 to revert to the default value
y - the vertical offset from the given HTML element or a value less than 0 to revert to the default value
Returns:
this object

setFollowmouse

public WalterZornTips setFollowmouse(boolean value)
The tooltip follows the movement of the mouse.

Parameters:
value - false for disabling or true for enabling;
Returns:
this object

setFontcolor

public WalterZornTips setFontcolor(java.lang.String fontcolor)
Sets the font color of the tooltip's content

Parameters:
fontcolor - the color or null to revert to the default value
Returns:
this object

setFontface

public WalterZornTips setFontface(java.lang.String fontface)
Sets the font face of the tooltip's content

Parameters:
fontface - the font face or null to revert to the default value
Returns:
this object

setFontsize

public WalterZornTips setFontsize(int px)
Sets the font size of the tooltip's content

Parameters:
px - the time or a value <= 0 to revert to the default value
Returns:
this object

setFontweight

public WalterZornTips setFontweight(java.lang.String fontweight)
Sets the font weight of the tooltip's content

Parameters:
fontweight - the font weight or null to revert to the default value
Returns:
this object

setHeight

public WalterZornTips setHeight(int px)
Sets the height of the tooltip in px

Parameters:
px - the height or 0 to revert to the default value
Returns:
this object

setJumphorz

public WalterZornTips setJumphorz(boolean value)
See the original documentation

Parameters:
value - false for disabling or true for enabling;
Returns:
this object

setJumpvert

public WalterZornTips setJumpvert(boolean value)
See the original documentation

Parameters:
value - false for disabling or true for enabling;
Returns:
this object

setLeft

public WalterZornTips setLeft(boolean value)
Positions the tooltip to the left ot the mouse pointer

Parameters:
value - false for disabling or true for enabling;
Returns:
this object

setOffsetX

public WalterZornTips setOffsetX(int px)
Sets the x-offset from the mouse pointer

Parameters:
px - the offset in px
Returns:
this object

setOffsetY

public WalterZornTips setOffsetY(int px)
Sets the y-offset from the mouse pointer

Parameters:
px - the offset in px
Returns:
this object

setOpacity

public WalterZornTips setOpacity(int value)
Sets the opacity of the tooltip content

Parameters:
value - the opacity in percent (0-100) or a negative number to revert to the default value
Returns:
this object

setPadding

public WalterZornTips setPadding(int px)
Sets the padding between the tooltip border and the contents.

Parameters:
px - the padding
Returns:
this object

setShadow

public WalterZornTips setShadow(boolean value)
Should the tooltip box drop a shadow

Parameters:
value - false for disabling or true for enabling;
Returns:
this object

setShadowColor

public WalterZornTips setShadowColor(java.lang.String color)
Sets the color of the tooltip's shadow

Parameters:
color - the color in CSS form e.g. #123456 or null to revert to the default value
Returns:
this object

setShadowWidth

public WalterZornTips setShadowWidth(int px)
Sets the width of the tooltip shadow in px

Parameters:
px - the width in px or a negative value to restore the default value
Returns:
this object

setSticky

public WalterZornTips setSticky(boolean value)
Should the tooltip stay fixed at it's initial position

Parameters:
value - false for disabling or true for enabling;
Returns:
this object

setTextalign

public WalterZornTips setTextalign(java.lang.String align)
Sets the alignment of the tooltip's text

Parameters:
align - the alignment or null to restore the default behavior
Returns:
this object

setTitle

public WalterZornTips setTitle(java.lang.String title)
Sets the title of te tooltip

Parameters:
title - the title or null to restore the default behavior
Returns:
this object

setTitleAlign

public WalterZornTips setTitleAlign(java.lang.String align)
Sets the alignment of the title

Parameters:
align - the alignment of the title or null to restore the default behavior
Returns:
this object

setTitleBgColor

public WalterZornTips setTitleBgColor(java.lang.String color)
Sets the background color of the title

Parameters:
color - the background color of the title or null to restore the default behavior
Returns:
this object

setTitleFontColor

public WalterZornTips setTitleFontColor(java.lang.String color)
Sets the text color of the title

Parameters:
color - the color of the title or null to restore the default behavior
Returns:
this object

setTitleFontFace

public WalterZornTips setTitleFontFace(java.lang.String fontface)
Sets the fontface color of the title

Parameters:
fontface - the color of the title or null to restore the default behavior
Returns:
this object

setTitleFontSize

public WalterZornTips setTitleFontSize(int px)
Sets the fontsize of the title

Parameters:
px - the fontsize or a negative value to restore the default value
Returns:
this object

setTitlePadding

public WalterZornTips setTitlePadding(int px)
Sets the padding around the title

Parameters:
px - the padding around the title or a negative value to restore the default value
Returns:
this object

setWidth

public WalterZornTips setWidth(int px)
Sets the width of the tooltip's box

Parameters:
px - the width of the tooltip's box or a value <= 0 to restore the default value
Returns:
this object


Copyright © 2010. All Rights Reserved.