aboutsummaryrefslogtreecommitdiffstats
path: root/uitest
diff options
context:
space:
mode:
authorAlexey Fansky <alexey.fansky@effective-soft.com>2015-04-01 15:08:58 -0700
committerMarkus Koivisto <markus@vaadin.com>2015-04-15 11:45:01 +0300
commit2d24d34b19d2ea93e8b2058218915672ad9f0f0e (patch)
tree1f74b2ea36cd06d0ddb673f7ec404a554d5588c1 /uitest
parent0ae745206a9ebc759a126606621f6cbd9f48b00d (diff)
downloadvaadin-framework-2d24d34b19d2ea93e8b2058218915672ad9f0f0e.tar.gz
vaadin-framework-2d24d34b19d2ea93e8b2058218915672ad9f0f0e.zip
Displaying tooltip on touch devices underneath the field (#17150)
Change-Id: I7381a6212b824f9dafc5fe7359b0e791f15c57b2
Diffstat (limited to 'uitest')
-rw-r--r--uitest/src/com/vaadin/tests/components/TouchDevicesTooltip.java66
1 files changed, 66 insertions, 0 deletions
diff --git a/uitest/src/com/vaadin/tests/components/TouchDevicesTooltip.java b/uitest/src/com/vaadin/tests/components/TouchDevicesTooltip.java
new file mode 100644
index 0000000000..ac4b48711e
--- /dev/null
+++ b/uitest/src/com/vaadin/tests/components/TouchDevicesTooltip.java
@@ -0,0 +1,66 @@
+package com.vaadin.tests.components;
+
+import com.vaadin.annotations.Viewport;
+import com.vaadin.data.util.converter.StringToIntegerConverter;
+import com.vaadin.data.validator.IntegerRangeValidator;
+import com.vaadin.server.VaadinRequest;
+import com.vaadin.ui.Label;
+import com.vaadin.ui.TextField;
+
+import javax.validation.constraints.Min;
+import javax.validation.constraints.NotNull;
+
+@Viewport(value = "width=device-width,height=device-height")
+public class TouchDevicesTooltip extends AbstractTestUI {
+
+ @Override
+ protected void setup(VaadinRequest request) {
+ final Label errorLabel = new Label("No error");
+ addComponent(errorLabel);
+
+ for (int i = 0; i < 50; i++) {
+ createTextField(i);
+ }
+ }
+
+ private void createTextField(int n) {
+ TextField textField = new TextField("Value" + n);
+ textField.setConverter(new StringToIntegerConverter());
+ textField.addValidator(new IntegerRangeValidator(getErrorMessage(n), 0, 100));
+ textField.setImmediate(true);
+ textField.setValue("-5");
+ addComponent(textField);
+ }
+
+ private String getErrorMessage(int n) {
+ if(n % 2 == 0) {
+ return "incorrect value" + n;
+ } else {
+ return "super long long long long long long long long long long long error message " + n;
+ }
+ }
+
+ public static class Bean {
+ @NotNull
+ @Min(0)
+ private Integer value;
+
+ public Integer getValue() {
+ return value;
+ }
+
+ public void setValue(Integer value) {
+ this.value = value;
+ }
+ }
+
+ @Override
+ protected Integer getTicketNumber() {
+ return 17150;
+ }
+
+ @Override
+ public String getDescription() {
+ return "Unable to dismiss a tooltip on touch devices";
+ }
+} \ No newline at end of file