com.extjs.gxt.ui.client.widget.tips
Class ToolTip

java.lang.Object
  extended by com.google.gwt.user.client.ui.UIObject
      extended by com.google.gwt.user.client.ui.Widget
          extended by com.extjs.gxt.ui.client.widget.Component
              extended by com.extjs.gxt.ui.client.widget.BoxComponent
                  extended by com.extjs.gxt.ui.client.widget.Container<T>
                      extended by com.extjs.gxt.ui.client.widget.ScrollContainer<Component>
                          extended by com.extjs.gxt.ui.client.widget.LayoutContainer
                              extended by com.extjs.gxt.ui.client.widget.ContentPanel
                                  extended by com.extjs.gxt.ui.client.widget.tips.Tip
                                      extended by com.extjs.gxt.ui.client.widget.tips.ToolTip
All Implemented Interfaces:
Listener<ComponentEvent>, Observable, com.google.gwt.user.client.EventListener

public class ToolTip
extends Tip
implements Listener<ComponentEvent>

A standard tooltip implementation for providing additional information when hovering over a target element.


Nested Class Summary
 
Nested classes/interfaces inherited from class com.google.gwt.user.client.ui.UIObject
com.google.gwt.user.client.ui.UIObject.DebugIdImpl, com.google.gwt.user.client.ui.UIObject.DebugIdImplEnabled
 
Field Summary
 
Fields inherited from class com.google.gwt.user.client.ui.UIObject
DEBUG_ID_PREFIX
 
Constructor Summary
ToolTip()
          Creates a new tool tip.
ToolTip(Component target)
          Creates a new tool tip.
ToolTip(Component target, ToolTipConfig config)
          Creates a new tool tip for the given target.
 
Method Summary
 int getDismissDelay()
          Returns the dismiss delay.
 int getHideDelay()
          Returns the hide delay.
 int[] getMouseOffset()
          Returns the mouse offsets.
 int getShowDelay()
          Returns the show delay.
 void handleEvent(ComponentEvent ce)
          Sent when an event that the listener has registered for occurs.
 void hide()
          Hide this component.
 boolean isAutoHide()
          Returns true if auto hide is enabled.
 boolean isTrackMouse()
          Returns true if mouse tracking is enabled.
 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 setDismissDelay(int dismissDelay)
          Delay in milliseconds before the tooltip automatically hides (defaults to 5000).
 void setHideDelay(int hideDelay)
          Delay in milliseconds after the mouse exits the target element but before the tooltip actually hides (defaults to 200).
 void setMouseOffset(int[] mouseOffset)
          An XY offset from the mouse position where the tooltip should be shown (defaults to [10,10]).
 void setShowDelay(int showDelay)
          Delay in milliseconds before the tooltip displays after the mouse enters the target element (defaults to 500).
 void setTrackMouse(boolean trackMouse)
          True to have the tooltip follow the mouse as it moves over the target element (defaults to false).
 void show()
          Show this component.
 void showAt(int x, int y)
          Shows this tip at the specified position.
 void update(ToolTipConfig config)
          Updates the tool tip with the given config.
 
Methods inherited from class com.extjs.gxt.ui.client.widget.tips.Tip
getMaxWidth, getMinWidth, getShadowPosition, isClosable, setClosable, setMaxWidth, setMinWidth, setShadowPosition, showAt
 
Methods inherited from class com.extjs.gxt.ui.client.widget.ContentPanel
addButton, collapse, expand, getAnimCollapse, getBodyBorder, getBodyStyle, getBottomComponent, getButtonAlign, getButtonBar, getCollapsible, getElement, getFooter, getFrame, getFrameHeight, getFrameWidth, getHeader, getInnerHeight, getInnerWidth, getLayoutTarget, getTitleCollapse, getTitleText, getTopComponent, getWidget, isExpanded, isHeaderVisible, isHideCollapseTool, onComponentEvent, setAnimCollapse, setBodyBorder, setBodyStyle, setBodyStyleName, setBottomComponent, setButtonAlign, setButtonBar, setCollapsible, setExpanded, setFooter, setFrame, setHeaderVisible, setHeading, setHideCollapseTool, setIconStyle, setInsetBorder, setTitleCollapse, setTopComponent, setUrl
 
Methods inherited from class com.extjs.gxt.ui.client.widget.LayoutContainer
add, add, addText, findComponent, getLayout, getLayoutOnChange, insert, insert, isMonitorResize, isMonitorWindowResize, layout, remove, removeAll, setLayout, setLayoutData, setLayoutOnChange, setMonitorWindowResize
 
Methods inherited from class com.extjs.gxt.ui.client.widget.ScrollContainer
addScrollListener, getHScrollPosition, getScrollMode, getVScrollPosition, removeScrollListener, scrollIntoView, setHScrollPosition, setScrollMode, setVScrollPosition
 
Methods inherited from class com.extjs.gxt.ui.client.widget.Container
findItem, getItem, getItemByItemId, getItemCount, getItems, getWidget, indexOf, iterator, scrollIntoView
 
Methods inherited from class com.extjs.gxt.ui.client.widget.BoxComponent
getBounds, getHeight, getHeight, getPosition, getShadow, getSize, getWidth, getWidth, isAutoHeight, isAutoWidth, isDeferHeight, isShim, setAutoHeight, setAutoWidth, setBounds, setBounds, setDeferHeight, setHeight, setHeight, setPagePosition, setPagePosition, setPixelSize, setPosition, setShadow, setShim, setSize, setSize, setWidth, setWidth
 
Methods inherited from class com.extjs.gxt.ui.client.widget.Component
addListener, addStyleName, addWidgetListener, disable, disableEvents, disableTextSelection, el, enable, enableEvents, fireEvent, fireEvent, fireEvent, fly, focus, getBaseStyle, getBorders, getData, getData, getElement, getId, getItemId, getModel, getState, getToolTip, hideToolTip, isEnabled, isRendered, isVisible, onBrowserEvent, recalculate, removeAllListeners, removeFromParent, removeListener, removeStyleName, removeWidgetListener, render, render, saveState, setBorders, setData, setData, setElement, setEnabled, setEnableState, setId, setIntStyleAttribute, setItemId, setStyleAttribute, setStyleName, setTitle, setToolTip, setToolTip, setVisible, toString
 
Methods inherited from class com.google.gwt.user.client.ui.Widget
getParent, isAttached
 
Methods inherited from class com.google.gwt.user.client.ui.UIObject
addStyleDependentName, ensureDebugId, ensureDebugId, getAbsoluteLeft, getAbsoluteTop, getOffsetHeight, getOffsetWidth, getStyleName, getStylePrimaryName, getTitle, isVisible, removeStyleDependentName, setStylePrimaryName, setVisible, sinkEvents, unsinkEvents
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

ToolTip

public ToolTip()
Creates a new tool tip.


ToolTip

public ToolTip(Component target)
Creates a new tool tip.

Parameters:
target - the target widget

ToolTip

public ToolTip(Component target,
               ToolTipConfig config)
Creates a new tool tip for the given target.

Parameters:
target - the target widget
Method Detail

getDismissDelay

public int getDismissDelay()
Returns the dismiss delay.

Returns:
the dismiss delay

getHideDelay

public int getHideDelay()
Returns the hide delay.

Returns:
the hide delay

getMouseOffset

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

Returns:
the mouse offsets

getShowDelay

public int getShowDelay()
Returns the show delay.

Returns:
the show delay

handleEvent

public void handleEvent(ComponentEvent ce)
Description copied from interface: Listener
Sent when an event that the listener has registered for occurs.

Specified by:
handleEvent in interface Listener<ComponentEvent>
Parameters:
ce - the event which occurred

hide

public void hide()
Description copied from class: Component
Hide this component. Fires the BeforeHide event before the component is hidden, the fires the Hide event after the component is hidden.

Overrides:
hide in class Component

isAutoHide

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

Returns:
the auto hide state

isTrackMouse

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

Returns:
the track mouse state

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). If Tip.closable = true a close tool button will be rendered into the tooltip header.

Parameters:
autoHide - the auto hide state

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 in milliseconds

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

setMouseOffset

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

Parameters:
mouseOffset - the mouse offsets

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 in milliseconds

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

show

public void show()
Description copied from class: Component
Show this component. Fires the BeforeShow event before the component is made visible, then fires the Show event after the component is visible.

Overrides:
show in class Component

showAt

public void showAt(int x,
                   int y)
Description copied from class: Tip
Shows this tip at the specified position.

Overrides:
showAt in class Tip
Parameters:
x - the x coordinate
y - the y coordiate

update

public void update(ToolTipConfig config)
Updates the tool tip with the given config.

Parameters:
config - the tool tip config