com.vaadin.client
Class VTooltip

java.lang.Object
  extended by PopupPanel
      extended by com.vaadin.client.ui.VOverlay
          extended by com.vaadin.client.VTooltip
All Implemented Interfaces:
com.google.gwt.event.logical.shared.CloseHandler<PopupPanel>, com.google.gwt.event.shared.EventHandler

public class VTooltip
extends VOverlay

TODO open for extension


Nested Class Summary
 
Nested classes/interfaces inherited from class com.vaadin.client.ui.VOverlay
VOverlay.PositionAndSize, VOverlay.ResizeAnimation
 
Field Summary
static int TOOLTIP_EVENTS
           
 
Fields inherited from class com.vaadin.client.ui.VOverlay
ac, ADDITIONAL_CLASSNAME_ANIMATE_IN, ADDITIONAL_CLASSNAME_ANIMATE_OUT, CLASSNAME_CONTAINER, CLASSNAME_SHADOW, current, Z_INDEX
 
Constructor Summary
VTooltip()
          Used to show tooltips; usually used via the singleton in ApplicationConnection.
 
Method Summary
 void connectHandlersToWidget(Widget widget)
          Connects DOM handlers to widget that are needed for tooltip presentation.
 int getCloseTimeout()
          Returns the time (in ms) the tooltip should be displayed after an event that will cause it to be closed (e.g.
 int getMaxWidth()
          Returns the maximum width of the tooltip popup.
 int getOpenDelay()
          Returns the time (in ms) that should elapse after an event triggering tooltip showing has occurred (e.g.
 int getQuickOpenDelay()
          Returns the time (in ms) that should elapse before a tooltip will be shown, in the situation when a tooltip has very recently been shown (within getQuickOpenDelay() ms).
 int getQuickOpenTimeout()
          Returns the time (in ms) during which getQuickOpenDelay() should be used instead of getOpenDelay().
 java.lang.String getUniqueId()
          Returns the unique id of the tooltip element.
 void hide()
           
 void hideTooltip()
           
 void initializeAssistiveTooltips()
          Initialize the tooltip overlay for assistive devices.
 boolean isTooltipOpen()
          For assistive tooltips to work correctly we must have the tooltip visible and attached to the DOM well in advance.
 void onBrowserEvent(Event event)
           
 void replaceCurrentTooltip()
          Replace current open tooltip with new content
 void setCloseTimeout(int closeTimeout)
          Sets the time (in ms) the tooltip should be displayed after an event that will cause it to be closed (e.g.
 void setMaxWidth(int maxWidth)
          Sets the maximum width of the tooltip popup.
 void setOpenDelay(int openDelay)
          Sets the time (in ms) that should elapse after an event triggering tooltip showing has occurred (e.g.
 void setPopupPositionAndShow(PositionCallback callback)
           
 void setQuickOpenDelay(int quickOpenDelay)
          Sets the time (in ms) that should elapse before a tooltip will be shown, in the situation when a tooltip has very recently been shown (within getQuickOpenDelay() ms).
 void setQuickOpenTimeout(int quickOpenTimeout)
          Sets the time (in ms) that determines when getQuickOpenDelay() should be used instead of getOpenDelay().
 void showAssistive(TooltipInfo info)
          Show the tooltip with the provided info for assistive devices.
 void updatePosition(Event event, boolean isFocused)
           
 
Methods inherited from class com.vaadin.client.ui.VOverlay
center, getApplicationConnection, getOverlayContainer, getOverlayContainer, getOwner, hide, isShadowEnabled, isShimElementEnabled, isSinkShadowEvents, needsShimElement, onClose, onDetach, positionOrSizeUpdated, setHeight, setOverlayContainerLabel, setOwner, setPopupPosition, setShadowEnabled, setShadowStyle, setSinkShadowEvents, setVisible, setWidth, setZIndex, show, sinkEvents, updateShadowSizeAndPosition, useShadowDiv
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface com.google.gwt.event.logical.shared.CloseHandler
onClose
 

Field Detail

TOOLTIP_EVENTS

public static final int TOOLTIP_EVENTS
Constructor Detail

VTooltip

public VTooltip()
Used to show tooltips; usually used via the singleton in ApplicationConnection. NOTE that #setOwner(Widget)} should be called after instantiating.

See Also:
ApplicationConnection.getVTooltip()
Method Detail

showAssistive

public void showAssistive(TooltipInfo info)
Show the tooltip with the provided info for assistive devices.

Parameters:
info - with the content of the tooltip

initializeAssistiveTooltips

public void initializeAssistiveTooltips()
Initialize the tooltip overlay for assistive devices.

Parameters:
info - with the content of the tooltip
Since:
7.2.4

isTooltipOpen

public boolean isTooltipOpen()
For assistive tooltips to work correctly we must have the tooltip visible and attached to the DOM well in advance. For this reason both isShowing and isVisible return false positives. We can't override either of them as external code may depend on this behavior.

Returns:
boolean

hideTooltip

public void hideTooltip()

hide

public void hide()
Overrides:
hide in class VOverlay

updatePosition

public void updatePosition(Event event,
                           boolean isFocused)

onBrowserEvent

public void onBrowserEvent(Event event)

replaceCurrentTooltip

public void replaceCurrentTooltip()
Replace current open tooltip with new content


connectHandlersToWidget

public void connectHandlersToWidget(Widget widget)
Connects DOM handlers to widget that are needed for tooltip presentation.

Parameters:
widget - Widget which DOM handlers are connected

getUniqueId

public java.lang.String getUniqueId()
Returns the unique id of the tooltip element.

Returns:
String containing the unique id of the tooltip, which always has a value

setPopupPositionAndShow

public void setPopupPositionAndShow(PositionCallback callback)

getCloseTimeout

public int getCloseTimeout()
Returns the time (in ms) the tooltip should be displayed after an event that will cause it to be closed (e.g. mouse click outside the component, key down).

Returns:
The close timeout (in ms)

setCloseTimeout

public void setCloseTimeout(int closeTimeout)
Sets the time (in ms) the tooltip should be displayed after an event that will cause it to be closed (e.g. mouse click outside the component, key down).

Parameters:
closeTimeout - The close timeout (in ms)

getQuickOpenTimeout

public int getQuickOpenTimeout()
Returns the time (in ms) during which getQuickOpenDelay() should be used instead of getOpenDelay(). The quick open delay is used when the tooltip has very recently been shown, is currently hidden but about to be shown again.

Returns:
The quick open timeout (in ms)

setQuickOpenTimeout

public void setQuickOpenTimeout(int quickOpenTimeout)
Sets the time (in ms) that determines when getQuickOpenDelay() should be used instead of getOpenDelay(). The quick open delay is used when the tooltip has very recently been shown, is currently hidden but about to be shown again.

Parameters:
quickOpenTimeout - The quick open timeout (in ms)

getQuickOpenDelay

public int getQuickOpenDelay()
Returns the time (in ms) that should elapse before a tooltip will be shown, in the situation when a tooltip has very recently been shown (within getQuickOpenDelay() ms).

Returns:
The quick open delay (in ms)

setQuickOpenDelay

public void setQuickOpenDelay(int quickOpenDelay)
Sets the time (in ms) that should elapse before a tooltip will be shown, in the situation when a tooltip has very recently been shown (within getQuickOpenDelay() ms).

Parameters:
quickOpenDelay - The quick open delay (in ms)

getOpenDelay

public int getOpenDelay()
Returns the time (in ms) that should elapse after an event triggering tooltip showing has occurred (e.g. mouse over) before the tooltip is shown. If a tooltip has recently been shown, then getQuickOpenDelay() is used instead of this.

Returns:
The open delay (in ms)

setOpenDelay

public void setOpenDelay(int openDelay)
Sets the time (in ms) that should elapse after an event triggering tooltip showing has occurred (e.g. mouse over) before the tooltip is shown. If a tooltip has recently been shown, then getQuickOpenDelay() is used instead of this.

Parameters:
openDelay - The open delay (in ms)

setMaxWidth

public void setMaxWidth(int maxWidth)
Sets the maximum width of the tooltip popup.

Parameters:
maxWidth - The maximum width the tooltip popup (in pixels)

getMaxWidth

public int getMaxWidth()
Returns the maximum width of the tooltip popup.

Returns:
The maximum width the tooltip popup (in pixels)


Copyright © 2000-2014 Vaadin Ltd. All Rights Reserved.