Package com.vaadin.client
Class VTooltip
- java.lang.Object
-
- com.google.gwt.user.client.ui.UIObject
-
- com.google.gwt.user.client.ui.Widget
-
- com.google.gwt.user.client.ui.Panel
-
- com.google.gwt.user.client.ui.SimplePanel
-
- com.google.gwt.user.client.ui.PopupPanel
-
- com.vaadin.client.widgets.Overlay
-
- com.vaadin.client.ui.VOverlay
-
- com.vaadin.client.VTooltip
-
- All Implemented Interfaces:
com.google.gwt.event.logical.shared.CloseHandler<com.google.gwt.user.client.ui.PopupPanel>
,com.google.gwt.event.logical.shared.HasAttachHandlers
,com.google.gwt.event.logical.shared.HasCloseHandlers<com.google.gwt.user.client.ui.PopupPanel>
,com.google.gwt.event.shared.EventHandler
,com.google.gwt.event.shared.HasHandlers
,com.google.gwt.user.client.EventListener
,com.google.gwt.user.client.EventPreview
,com.google.gwt.user.client.ui.AcceptsOneWidget
,com.google.gwt.user.client.ui.HasAnimation
,com.google.gwt.user.client.ui.HasOneWidget
,com.google.gwt.user.client.ui.HasVisibility
,com.google.gwt.user.client.ui.HasWidgets
,com.google.gwt.user.client.ui.HasWidgets.ForIsWidget
,com.google.gwt.user.client.ui.IsWidget
,com.google.gwt.user.client.ui.SourcesPopupEvents
,Iterable<com.google.gwt.user.client.ui.Widget>
public class VTooltip extends VOverlay
TODO open for extension
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from class com.vaadin.client.widgets.Overlay
Overlay.PositionAndSize, Overlay.ResizeAnimation
-
Nested classes/interfaces inherited from class com.google.gwt.user.client.ui.PopupPanel
com.google.gwt.user.client.ui.PopupPanel.AnimationType, com.google.gwt.user.client.ui.PopupPanel.PositionCallback
-
-
Field Summary
Fields Modifier and Type Field Description static int
TOOLTIP_EVENTS
-
Fields inherited from class com.vaadin.client.widgets.Overlay
ADDITIONAL_CLASSNAME_ANIMATE_IN, ADDITIONAL_CLASSNAME_ANIMATE_OUT, CLASSNAME_CONTAINER, CLASSNAME_SHADOW, Z_INDEX
-
-
Constructor Summary
Constructors Constructor Description VTooltip()
Used to show tooltips; usually used via the singleton inApplicationConnection
.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
connectHandlersToWidget(com.google.gwt.user.client.ui.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 (withingetQuickOpenDelay()
ms).int
getQuickOpenTimeout()
Returns the time (in ms) during whichgetQuickOpenDelay()
should be used instead ofgetOpenDelay()
.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(com.google.gwt.user.client.Event event)
void
replaceCurrentTooltip()
Replace current open tooltip with new contentvoid
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(com.google.gwt.user.client.ui.PopupPanel.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 (withingetQuickOpenDelay()
ms).void
setQuickOpenTimeout(int quickOpenTimeout)
Sets the time (in ms) that determines whengetQuickOpenDelay()
should be used instead ofgetOpenDelay()
.void
showAssistive(TooltipInfo info)
Show the tooltip with the provided info for assistive devices.void
updatePosition(com.google.gwt.user.client.Event event, boolean isFocused)
-
Methods inherited from class com.vaadin.client.ui.VOverlay
getApplicationConnection, getOverlayContainer, getOverlayContainer, setOverlayContainerLabel
-
Methods inherited from class com.vaadin.client.widgets.Overlay
center, getOwner, hide, hide, isFitInWindow, isShadowEnabled, isShimElementEnabled, isSinkShadowEvents, needsShimElement, onAttach, onClose, onDetach, positionOrSizeUpdated, setFitInWindow, setHeight, setOwner, setPopupPosition, setShadowEnabled, setShadowStyle, setSinkShadowEvents, setVisible, setWidth, setZIndex, show, sinkEvents, updateShadowSizeAndPosition, useShadowDiv
-
Methods inherited from class com.google.gwt.user.client.ui.PopupPanel
addAutoHidePartner, addCloseHandler, addPopupListener, getAnimationType, getContainerElement, getGlassElement, getGlassStyleName, getOffsetHeight, getOffsetWidth, getPopupLeft, getPopupTop, getStyleElement, getTitle, isAnimationEnabled, isAutoHideEnabled, isAutoHideOnHistoryEventsEnabled, isGlassEnabled, isModal, isPreviewingAllNativeEvents, isShowing, isVisible, onEventPreview, onKeyDownPreview, onKeyPressPreview, onKeyUpPreview, onPreviewNativeEvent, onUnload, removeAutoHidePartner, removePopupListener, setAnimationEnabled, setAnimationType, setAutoHideEnabled, setAutoHideOnHistoryEventsEnabled, setGlassEnabled, setGlassStyleName, setModal, setPreviewingAllNativeEvents, setTitle, setWidget, showRelativeTo
-
Methods inherited from class com.google.gwt.user.client.ui.SimplePanel
add, getWidget, iterator, remove, setWidget
-
Methods inherited from class com.google.gwt.user.client.ui.Panel
add, adopt, clear, doAttachChildren, doDetachChildren, orphan, remove
-
Methods inherited from class com.google.gwt.user.client.ui.Widget
addAttachHandler, addBitlessDomHandler, addDomHandler, addHandler, asWidget, asWidgetOrNull, createHandlerManager, delegateEvent, fireEvent, getHandlerCount, getLayoutData, getParent, isAttached, isOrWasAttached, onLoad, removeFromParent, setLayoutData, unsinkEvents
-
Methods inherited from class com.google.gwt.user.client.ui.UIObject
addStyleDependentName, addStyleName, ensureDebugId, ensureDebugId, ensureDebugId, getAbsoluteLeft, getAbsoluteTop, getElement, getStyleName, getStyleName, getStylePrimaryName, getStylePrimaryName, isVisible, onEnsureDebugId, removeStyleDependentName, removeStyleName, resolvePotentialElement, setElement, setElement, setPixelSize, setSize, setStyleDependentName, setStyleName, setStyleName, setStyleName, setStyleName, setStylePrimaryName, setStylePrimaryName, setVisible, sinkBitlessEvent, toString
-
-
-
-
Field Detail
-
TOOLTIP_EVENTS
public static final int TOOLTIP_EVENTS
- See Also:
- Constant Field Values
-
-
Constructor Detail
-
VTooltip
public VTooltip()
Used to show tooltips; usually used via the singleton inApplicationConnection
. 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()
-
updatePosition
public void updatePosition(com.google.gwt.user.client.Event event, boolean isFocused)
-
onBrowserEvent
public void onBrowserEvent(com.google.gwt.user.client.Event event)
- Specified by:
onBrowserEvent
in interfacecom.google.gwt.user.client.EventListener
- Overrides:
onBrowserEvent
in classcom.google.gwt.user.client.ui.Widget
-
replaceCurrentTooltip
public void replaceCurrentTooltip()
Replace current open tooltip with new content
-
connectHandlersToWidget
public void connectHandlersToWidget(com.google.gwt.user.client.ui.Widget widget)
Connects DOM handlers to widget that are needed for tooltip presentation.- Parameters:
widget
- Widget which DOM handlers are connected
-
getUniqueId
public 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(com.google.gwt.user.client.ui.PopupPanel.PositionCallback callback)
- Overrides:
setPopupPositionAndShow
in classcom.google.gwt.user.client.ui.PopupPanel
-
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 whichgetQuickOpenDelay()
should be used instead ofgetOpenDelay()
. 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 whengetQuickOpenDelay()
should be used instead ofgetOpenDelay()
. 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 (withingetQuickOpenDelay()
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 (withingetQuickOpenDelay()
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, thengetQuickOpenDelay()
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, thengetQuickOpenDelay()
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)
-
-