From 34e6c60a5a746c0306c3a84ae8d6c21dfd84d878 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Leif=20=C3=85strand?= Date: Mon, 20 May 2013 16:45:56 +0300 Subject: [PATCH] Always add tooltip event handlers for Window (#11448) This is needed to ensure tooltips are closed when moving the mouse outside the component but still inside the window. In 7.1, this should instead be implemented by overriding hasTooltip() to return true. Merge: manual Change-Id: I48d47474a4e4f0303fd85552612f6960fcdce0a7 --- .../vaadin/client/ui/window/WindowConnector.java | 11 +++++++++++ .../tests/components/window/TooltipInWindow.html | 16 ++++++++++++++++ 2 files changed, 27 insertions(+) diff --git a/client/src/com/vaadin/client/ui/window/WindowConnector.java b/client/src/com/vaadin/client/ui/window/WindowConnector.java index 8cfc25a9dc..a394a33882 100644 --- a/client/src/com/vaadin/client/ui/window/WindowConnector.java +++ b/client/src/com/vaadin/client/ui/window/WindowConnector.java @@ -29,6 +29,7 @@ import com.vaadin.client.ComponentConnector; import com.vaadin.client.ConnectorHierarchyChangeEvent; import com.vaadin.client.LayoutManager; import com.vaadin.client.Paintable; +import com.vaadin.client.TooltipInfo; import com.vaadin.client.UIDL; import com.vaadin.client.Util; import com.vaadin.client.ui.AbstractSingleComponentContainerConnector; @@ -312,4 +313,14 @@ public class WindowConnector extends AbstractSingleComponentContainerConnector public void setWindowOrderAndPosition() { getWidget().setWindowOrderAndPosition(); } + + @Override + public TooltipInfo getTooltipInfo(com.google.gwt.dom.client.Element element) { + /* + * Override method to make AbstractComponentConnector.hasTooltip() + * return true so there's a top level handler that takes care of hiding + * tooltips whenever the mouse is moved somewhere else. + */ + return super.getTooltipInfo(element); + } } diff --git a/uitest/src/com/vaadin/tests/components/window/TooltipInWindow.html b/uitest/src/com/vaadin/tests/components/window/TooltipInWindow.html index d734cab9ea..63e371e379 100644 --- a/uitest/src/com/vaadin/tests/components/window/TooltipInWindow.html +++ b/uitest/src/com/vaadin/tests/components/window/TooltipInWindow.html @@ -64,6 +64,22 @@ vaadin=runcomvaadintestscomponentswindowTooltipInWindow::Root/VTooltip[0]/FlowPanel[0]/domChild[1] My tooltip + + + showTooltip + vaadin=runcomvaadintestscomponentswindowTooltipInWindow::/VWindow[0]/FocusableScrollPanel[0]/VVerticalLayout[0] + 0,0 + + + pause + 1000 + + + + assertElementNotPresent + vaadin=runcomvaadintestscomponentswindowTooltipInWindow::Root/VTooltip[0]/FlowPanel[0]/domChild[1] + + -- 2.39.5