diff options
author | Leif Åstrand <leif@vaadin.com> | 2013-05-20 16:45:56 +0300 |
---|---|---|
committer | Leif Åstrand <leif@vaadin.com> | 2013-05-20 16:45:56 +0300 |
commit | 34e6c60a5a746c0306c3a84ae8d6c21dfd84d878 (patch) | |
tree | 270bc467412a1bab6968c4f59b709f3145c7fb07 | |
parent | 0c8edf1ff0502070d92dc6d8ef5af304d7570934 (diff) | |
download | vaadin-framework-34e6c60a5a746c0306c3a84ae8d6c21dfd84d878.tar.gz vaadin-framework-34e6c60a5a746c0306c3a84ae8d6c21dfd84d878.zip |
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
-rw-r--r-- | client/src/com/vaadin/client/ui/window/WindowConnector.java | 11 | ||||
-rw-r--r-- | uitest/src/com/vaadin/tests/components/window/TooltipInWindow.html | 16 |
2 files changed, 27 insertions, 0 deletions
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 @@ <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> |