aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAutomerge <automerge@vaadin.com>2012-06-01 09:07:29 +0000
committerAutomerge <automerge@vaadin.com>2012-06-01 09:07:29 +0000
commitd1b21ae7f7a52542ee56a150a5495bf52b1d0b25 (patch)
tree626300b34867773a1a2786b1efa9a282f075dc30
parent6f729f5d55cdfb719e8de835d4c713225bfd7ef2 (diff)
downloadvaadin-framework-d1b21ae7f7a52542ee56a150a5495bf52b1d0b25.tar.gz
vaadin-framework-d1b21ae7f7a52542ee56a150a5495bf52b1d0b25.zip
[merge from 6.7] Made tooltips work for Slider (#8863)
svn changeset:23873/svn branch:6.8
-rw-r--r--src/com/vaadin/terminal/gwt/client/ui/VSlider.java6
-rw-r--r--tests/testbench/com/vaadin/tests/components/slider/SliderTooltip.html67
2 files changed, 73 insertions, 0 deletions
diff --git a/src/com/vaadin/terminal/gwt/client/ui/VSlider.java b/src/com/vaadin/terminal/gwt/client/ui/VSlider.java
index e605c6fe12..84a7284944 100644
--- a/src/com/vaadin/terminal/gwt/client/ui/VSlider.java
+++ b/src/com/vaadin/terminal/gwt/client/ui/VSlider.java
@@ -20,6 +20,7 @@ import com.vaadin.terminal.gwt.client.Paintable;
import com.vaadin.terminal.gwt.client.UIDL;
import com.vaadin.terminal.gwt.client.Util;
import com.vaadin.terminal.gwt.client.VConsole;
+import com.vaadin.terminal.gwt.client.VTooltip;
public class VSlider extends SimpleFocusablePanel implements Paintable, Field,
ContainerResizedListener {
@@ -113,6 +114,8 @@ public class VSlider extends SimpleFocusablePanel implements Paintable, Field,
feedbackPopup.addStyleName(CLASSNAME + "-feedback");
feedbackPopup.setWidget(feedback);
+
+ sinkEvents(VTooltip.TOOLTIP_EVENTS);
}
public void updateFromUIDL(UIDL uidl, ApplicationConnection client) {
@@ -369,6 +372,9 @@ public class VSlider extends SimpleFocusablePanel implements Paintable, Field,
event.preventDefault(); // avoid simulated events
event.stopPropagation();
}
+ if (client != null) {
+ client.handleTooltipEvent(event, this);
+ }
}
private void processMouseWheelEvent(final Event event) {
diff --git a/tests/testbench/com/vaadin/tests/components/slider/SliderTooltip.html b/tests/testbench/com/vaadin/tests/components/slider/SliderTooltip.html
new file mode 100644
index 0000000000..4e8296050f
--- /dev/null
+++ b/tests/testbench/com/vaadin/tests/components/slider/SliderTooltip.html
@@ -0,0 +1,67 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
+<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
+<head profile="http://selenium-ide.openqa.org/profiles/test-case">
+<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
+<link rel="selenium.base" href="http://arturwin.office.itmill.com:9999/" />
+<title>New Test</title>
+</head>
+<body>
+<table cellpadding="1" cellspacing="1" border="1">
+<thead>
+<tr><td rowspan="1" colspan="3">New Test</td></tr>
+</thead><tbody>
+<tr>
+ <td>open</td>
+ <td>/run/com.vaadin.tests.components.slider.SliderTest?debug&amp;restartApplication</td>
+ <td></td>
+</tr>
+<tr>
+ <td>mouseClick</td>
+ <td>vaadin=runcomvaadintestscomponentssliderSliderTest::PID_Smenu#item0</td>
+ <td>24,2</td>
+</tr>
+<tr>
+ <td>mouseClick</td>
+ <td>vaadin=runcomvaadintestscomponentssliderSliderTest::Root/VOverlay[0]/VMenuBar[0]#item1</td>
+ <td>35,12</td>
+</tr>
+<tr>
+ <td>mouseClick</td>
+ <td>vaadin=runcomvaadintestscomponentssliderSliderTest::Root/VOverlay[1]/VMenuBar[0]#item1</td>
+ <td>74,3</td>
+</tr>
+<tr>
+ <td>mouseClick</td>
+ <td>vaadin=runcomvaadintestscomponentssliderSliderTest::Root/VOverlay[2]/VMenuBar[0]#item2</td>
+ <td>30,6</td>
+</tr>
+<tr>
+ <td>showTooltip</td>
+ <td>vaadin=runcomvaadintestscomponentssliderSliderTest::PID_StestComponent/domChild[2]/domChild[0]</td>
+ <td>0,0</td>
+</tr>
+<tr>
+ <td>waitForElementPresent</td>
+ <td>vaadin=runcomvaadintestscomponentssliderSliderTest::Root/VTooltip[0]/FlowPanel[0]/domChild[1]</td>
+ <td></td>
+</tr>
+<tr>
+ <td>assertText</td>
+ <td>vaadin=runcomvaadintestscomponentssliderSliderTest::Root/VTooltip[0]/FlowPanel[0]/domChild[1]</td>
+ <td>This is a semi-long text that might wrap.</td>
+</tr>
+<tr>
+ <td>mouseClick</td>
+ <td>vaadin=runcomvaadintestscomponentssliderSliderTest::/VVerticalLayout[0]/ChildComponentContainer[0]/VLabel[0]</td>
+ <td>40,16</td>
+</tr>
+<tr>
+ <td>waitForElementNotPresent</td>
+ <td>vaadin=runcomvaadintestscomponentssliderSliderTest::Root/VTooltip[0]/FlowPanel[0]/domChild[1]</td>
+ <td></td>
+</tr>
+
+</tbody></table>
+</body>
+</html>