com.sencha.gxt.widget.core.client.tips
Class ToolTipConfig

java.lang.Object
  extended by com.sencha.gxt.widget.core.client.tips.ToolTipConfig
All Implemented Interfaces:
HasUiAttributes

public class ToolTipConfig
extends java.lang.Object
implements HasUiAttributes

Configuration information for a tool tip.


Nested Class Summary
static interface ToolTipConfig.ToolTipRenderer<T>
           
 
Constructor Summary
ToolTipConfig()
          Creates a new tool tip config.
ToolTipConfig(java.lang.String text)
          Creates a new tool tip config with the given text.
ToolTipConfig(java.lang.String title, java.lang.String text)
          Creates a new tool tip config with the given title and text.
 
Method Summary
 Style.Side getAnchor()
          Returns the anchor position.
 int getAnchorOffset()
          Returns the distance in pixels of the tooltip and target element.
 java.lang.String getBodyHtml()
          Returns the tool tip text.
 java.lang.Object getData()
          Returns the data for the renderer.
 int getDismissDelay()
          Returns the dismiss delay.
 int getHideDelay()
          Returns the hide delay in milliseconds.
 int getMaxWidth()
          Returns the tooltip's maximum width.
 int getMinWidth()
          Returns the tooltip's minimum width.
 int[] getMouseOffset()
          Returns the mouse offset.
 ToolTipConfig.ToolTipRenderer<?> getRenderer()
          Returns the renderer.
 int getShowDelay()
          Returns the show delay in milliseconds.
 java.lang.String getTitleHtml()
          Returns the tool tip title.
 boolean isAnchorToTarget()
          Returns true if the tooltip is anchored to the target.
 boolean isAutoHide()
          Returns true if auto hide is enabled.
 boolean isCloseable()
          Returns true if the tip is closable.
 boolean isEnabled()
          Returns true if the tool tip is enabled.
 boolean isTrackMouse()
          Returns true if mouse tracking is enabled.
 void setAnchor(Style.Side anchor)
          Sets the anchor position (defaults to "bottom").
 void setAnchorOffset(int anchorOffset)
          A numeric pixel value used to offset the default position of the anchor arrow (defaults to 0).
 void setAnchorToTarget(boolean anchorToTarget)
          True to anchor the tooltip to the target element, false to anchor it relative to the mouse coordinates (defaults to true).
 void setAutoHide(boolean autoHide)
          True to automatically hide the tooltip after the mouse exits the target element or after the dismissDelay has expired if set (defaults to true).
 void setBodyHtml(SafeHtml bodyHtml)
           
 void setBodyHtml(java.lang.String bodyHtml)
          The tool tip text.
 void setBodyText(java.lang.String bodyText)
           
 void setCloseable(boolean closeable)
          True to render a close tool button into the tooltip header (defaults to false).
 void setData(java.lang.Object data)
          The parameters to be used when a custom a renderer is specified.
 void setDismissDelay(int dismissDelay)
          Delay in milliseconds before the tooltip automatically hides (defaults to 5000).
 void setEnabled(boolean enabled)
          Sets whether the tool tip is enabled (defaults to true).
 void setHideDelay(int hideDelay)
          Delay in milliseconds after the mouse exits the target element but before the tooltip actually hides (defaults to 200).
 void setMaxWidth(int maxWidth)
          Sets the tooltip's maximum width (defaults to 300).
 void setMinWidth(int minWidth)
          Sets the tooltip's minimum width (defaults to 40).
 void setMouseOffset(int[] mouseOffset)
          An XY offset from the mouse position where the tooltip should be shown (defaults to [15,18]).
 void setMouseOffsetX(int x)
          Sets the X offset from the mouse position where the tooltip should be shown (defaults to 15)
 void setMouseOffsetY(int y)
          Sets the Y offset from the mouse position where the tooltip should be shown (defaults to 18)
 void setRenderer(ToolTipConfig.ToolTipRenderer<?> renderer)
          A optional renderer to be used to render the tool tip.
 void setShowDelay(int showDelay)
          Delay in milliseconds before the tooltip displays after the mouse enters the target element (defaults to 500).
 void setTitleHtml(SafeHtml titleHtml)
           
 void setTitleHtml(java.lang.String titleHtml)
          Sets the tool tip title.
 void setTitleText(java.lang.String titleText)
           
 void setTrackMouse(boolean trackMouse)
          True to have the tooltip follow the mouse as it moves over the target element (defaults to false).
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ToolTipConfig

public ToolTipConfig()
Creates a new tool tip config.


ToolTipConfig

public ToolTipConfig(java.lang.String text)
Creates a new tool tip config with the given text.

Parameters:
text - the tool tip text

ToolTipConfig

public ToolTipConfig(java.lang.String title,
                     java.lang.String text)
Creates a new tool tip config with the given title and text.

Parameters:
title - the tool tip title
text - the tool tip text
Method Detail

getAnchor

public Style.Side getAnchor()
Returns the anchor position.

Returns:
the anchor position

getAnchorOffset

public int getAnchorOffset()
Returns the distance in pixels of the tooltip and target element.

Returns:
the offset

getBodyHtml

public java.lang.String getBodyHtml()
Returns the tool tip text.

Returns:
the text

getData

public java.lang.Object getData()
Returns the data for the renderer.

Returns:
the data

getDismissDelay

public int getDismissDelay()
Returns the dismiss delay.

Returns:
the dismiss delay

getHideDelay

public int getHideDelay()
Returns the hide delay in milliseconds.

Returns:
the delay

getMaxWidth

public int getMaxWidth()
Returns the tooltip's maximum width.

Returns:
the maximum width

getMinWidth

public int getMinWidth()
Returns the tooltip's minimum width.

Returns:
the minimum width

getMouseOffset

public int[] getMouseOffset()
Returns the mouse offset.

Returns:
the offset

getRenderer

public ToolTipConfig.ToolTipRenderer<?> getRenderer()
Returns the renderer.

Returns:
the template

getShowDelay

public int getShowDelay()
Returns the show delay in milliseconds.

Returns:
the delay

getTitleHtml

public java.lang.String getTitleHtml()
Returns the tool tip title.

Returns:
the title

isAnchorToTarget

public boolean isAnchorToTarget()
Returns true if the tooltip is anchored to the target.

Returns:
true if anchored

isAutoHide

public boolean isAutoHide()
Returns true if auto hide is enabled.

Returns:
the auto hide state

isCloseable

public boolean isCloseable()
Returns true if the tip is closable.

Returns:
the closable state

isEnabled

public boolean isEnabled()
Returns true if the tool tip is enabled.

Returns:
true for enabled

isTrackMouse

public boolean isTrackMouse()
Returns true if mouse tracking is enabled.

Returns:
the mouse track state

setAnchor

public void setAnchor(Style.Side anchor)
Sets the anchor position (defaults to "bottom").

Parameters:
anchor - the anchor position (top, bottom, left, right)

setAnchorOffset

public void setAnchorOffset(int anchorOffset)
A numeric pixel value used to offset the default position of the anchor arrow (defaults to 0). When the anchor position is on the top or bottom of the tooltip, anchorOffset will be used as a horizontal offset. Likewise, when the anchor position is on the left or right side, anchorOffset will be used as a vertical offset.

Parameters:
anchorOffset - the offset in pixels

setAnchorToTarget

public void setAnchorToTarget(boolean anchorToTarget)
True to anchor the tooltip to the target element, false to anchor it relative to the mouse coordinates (defaults to true).

Parameters:
anchorToTarget - true to anchor the tooltip to the target element

setAutoHide

public void setAutoHide(boolean autoHide)
True to automatically hide the tooltip after the mouse exits the target element or after the dismissDelay has expired if set (defaults to true).

Parameters:
autoHide - the auto hide state

setBodyHtml

public void setBodyHtml(SafeHtml bodyHtml)

setBodyHtml

public void setBodyHtml(java.lang.String bodyHtml)
The tool tip text.

Parameters:
bodyHtml - the text

setBodyText

public void setBodyText(java.lang.String bodyText)

setCloseable

public void setCloseable(boolean closeable)
True to render a close tool button into the tooltip header (defaults to false).

Parameters:
closeable - the closable state

setData

public void setData(java.lang.Object data)
The parameters to be used when a custom a renderer is specified.

Parameters:
data - the data

setDismissDelay

public void setDismissDelay(int dismissDelay)
Delay in milliseconds before the tooltip automatically hides (defaults to 5000). To disable automatic hiding, set dismissDelay = 0.

Parameters:
dismissDelay - the dismiss delay

setEnabled

public void setEnabled(boolean enabled)
Sets whether the tool tip is enabled (defaults to true).

Parameters:
enabled - true to enable

setHideDelay

public void setHideDelay(int hideDelay)
Delay in milliseconds after the mouse exits the target element but before the tooltip actually hides (defaults to 200). Set to 0 for the tooltip to hide immediately.

Parameters:
hideDelay - the hide delay

setMaxWidth

public void setMaxWidth(int maxWidth)
Sets the tooltip's maximum width (defaults to 300).

Parameters:
maxWidth - the maximum width in pixels

setMinWidth

public void setMinWidth(int minWidth)
Sets the tooltip's minimum width (defaults to 40).

Parameters:
minWidth - the minimum width

setMouseOffset

public void setMouseOffset(int[] mouseOffset)
An XY offset from the mouse position where the tooltip should be shown (defaults to [15,18]).

Parameters:
mouseOffset - the offset

setMouseOffsetX

public void setMouseOffsetX(int x)
Sets the X offset from the mouse position where the tooltip should be shown (defaults to 15)

Parameters:
x - the x axis offset

setMouseOffsetY

public void setMouseOffsetY(int y)
Sets the Y offset from the mouse position where the tooltip should be shown (defaults to 18)

Parameters:
y - the y axis offset

setRenderer

public void setRenderer(ToolTipConfig.ToolTipRenderer<?> renderer)
A optional renderer to be used to render the tool tip. The setData(Object) will be applied to the template.

Parameters:
renderer - the renderer

setShowDelay

public void setShowDelay(int showDelay)
Delay in milliseconds before the tooltip displays after the mouse enters the target element (defaults to 500).

Parameters:
showDelay - the show delay

setTitleHtml

public void setTitleHtml(SafeHtml titleHtml)

setTitleHtml

public void setTitleHtml(java.lang.String titleHtml)
Sets the tool tip title.

Parameters:
titleHtml - the title

setTitleText

public void setTitleText(java.lang.String titleText)

setTrackMouse

public void setTrackMouse(boolean trackMouse)
True to have the tooltip follow the mouse as it moves over the target element (defaults to false).

Parameters:
trackMouse - the track mouse state


Copyright © 2012. All Rights Reserved.