public class ToolTipConfig extends Object implements HasUiAttributes
Modifier and Type | Class and Description |
---|---|
static interface |
ToolTipConfig.ToolTipRenderer<T> |
Constructor and Description |
---|
ToolTipConfig()
Creates a new tool tip config.
|
ToolTipConfig(SafeHtml title,
SafeHtml html)
Creates a new tool tip config with the given title and text.
|
ToolTipConfig(String text)
Creates a new tool tip config with the given text.
|
ToolTipConfig(String title,
String text)
Creates a new tool tip config with the given title and text.
|
Modifier and Type | Method and Description |
---|---|
Style.Side |
getAnchor()
Returns the anchor position.
|
int |
getAnchorOffset()
Returns the distance in pixels of the tooltip and target element.
|
String |
getBodyHtml()
Returns the tool tip text.
|
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 |
getMouseOffsetX()
Gets the X offset from the mouse position where the tooltip should be shown
|
int |
getMouseOffsetY()
Gets the Y offset from the mouse position where the tooltip should be shown
|
ToolTipConfig.ToolTipRenderer<?> |
getRenderer()
Returns the renderer.
|
int |
getShowDelay()
Returns the show delay in milliseconds.
|
String |
getTitleHtml()
Returns the tool tip title.
|
boolean |
isAnchorArrow()
Returns the anchor arrow enabled.
|
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 |
setAnchorArrow(boolean anchorArrowEnabled)
Turn on and off the anchor arrow.
|
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)
The tool tip text or html.
|
void |
setBodyHtml(String bodyHtml)
The tool tip text.
|
void |
setBodyText(String bodyText)
The tool tip text.
|
void |
setCloseable(boolean closeable)
True to render a close tool button into the tooltip header (defaults to
false).
|
void |
setData(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 |
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(String titleHtml)
Sets the tool tip title.
|
void |
setTitleText(String titleText) |
void |
setTrackMouse(boolean trackMouse)
True to have the tooltip follow the mouse as it moves over the target
element (defaults to false).
|
public ToolTipConfig()
public ToolTipConfig(String text)
text
- the tool tip text as textpublic ToolTipConfig(String title, String text)
title
- the tool tip title as texttext
- the tool tip text as textpublic Style.Side getAnchor()
public int getAnchorOffset()
public String getBodyHtml()
public Object getData()
public int getDismissDelay()
public int getHideDelay()
public int getMaxWidth()
public int getMinWidth()
public int getMouseOffsetX()
public int getMouseOffsetY()
public ToolTipConfig.ToolTipRenderer<?> getRenderer()
public int getShowDelay()
public String getTitleHtml()
public boolean isAnchorArrow()
public boolean isAnchorToTarget()
public boolean isAutoHide()
public boolean isCloseable()
public boolean isEnabled()
public boolean isTrackMouse()
public void setAnchor(Style.Side anchor)
anchor
- the anchor position (top, bottom, left, right)public void setAnchorArrow(boolean anchorArrowEnabled)
anchorArrowEnabled
- enables the arrowpublic void setAnchorOffset(int anchorOffset)
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.anchorOffset
- the offset in pixelspublic void setAnchorToTarget(boolean anchorToTarget)
anchorToTarget
- true to anchor the tooltip to the target elementpublic void setAutoHide(boolean autoHide)
dismissDelay
has expired if set (defaults to
true).autoHide
- the auto hide statepublic void setBodyHtml(SafeHtml bodyHtml)
bodyHtml
- the tip text or htmlpublic void setBodyHtml(String bodyHtml)
bodyHtml
- the tip textpublic void setBodyText(String bodyText)
bodyText
- the tip textpublic void setCloseable(boolean closeable)
closeable
- the closable statepublic void setData(Object data)
renderer
is specified.data
- the datapublic void setDismissDelay(int dismissDelay)
dismissDelay
- the dismiss delaypublic void setEnabled(boolean enabled)
enabled
- true to enablepublic void setHideDelay(int hideDelay)
hideDelay
- the hide delaypublic void setMaxWidth(int maxWidth)
maxWidth
- the maximum width in pixelspublic void setMinWidth(int minWidth)
minWidth
- the minimum widthpublic void setMouseOffsetX(int x)
x
- the x axis offsetpublic void setMouseOffsetY(int y)
y
- the y axis offsetpublic void setRenderer(ToolTipConfig.ToolTipRenderer<?> renderer)
setData(Object)
will be applied to the template.renderer
- the rendererpublic void setShowDelay(int showDelay)
showDelay
- the show delaypublic void setTitleHtml(SafeHtml titleHtml)
public void setTitleHtml(String titleHtml)
titleHtml
- the titlepublic void setTitleText(String titleText)
public void setTrackMouse(boolean trackMouse)
trackMouse
- the track mouse stateCopyright © 2015. All rights reserved.