]> source.dussan.org Git - vaadin-framework.git/commitdiff
Always add tooltip event handlers for Window (#11448)
authorLeif Åstrand <leif@vaadin.com>
Mon, 20 May 2013 13:45:56 +0000 (16:45 +0300)
committerLeif Åstrand <leif@vaadin.com>
Mon, 20 May 2013 13:45:56 +0000 (16:45 +0300)
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

client/src/com/vaadin/client/ui/window/WindowConnector.java
uitest/src/com/vaadin/tests/components/window/TooltipInWindow.html

index 8cfc25a9dcf6ad18618d8e21299e518117605c26..a394a33882ea2458db52c0706599fbf5b11392d1 100644 (file)
@@ -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);
+    }
 }
index d734cab9eafc931a84292633b028535687a861a1..63e371e379171dc7242d867b7c43d6b8ddae3832 100644 (file)
        <td>vaadin=runcomvaadintestscomponentswindowTooltipInWindow::Root/VTooltip[0]/FlowPanel[0]/domChild[1]</td>
        <td>My tooltip</td>
 </tr>
+<!-- Hide tooltip in Window -->
+<tr>
+       <td>showTooltip</td>
+       <td>vaadin=runcomvaadintestscomponentswindowTooltipInWindow::/VWindow[0]/FocusableScrollPanel[0]/VVerticalLayout[0]</td>
+       <td>0,0</td>
+</tr>
+<tr>
+       <td>pause</td>
+       <td>1000</td>
+       <td></td>
+</tr>
+<tr>
+       <td>assertElementNotPresent</td>
+       <td>vaadin=runcomvaadintestscomponentswindowTooltipInWindow::Root/VTooltip[0]/FlowPanel[0]/domChild[1]</td>
+       <td></td>
+</tr>
 </tbody></table>
 </body>
 </html>