From 05fc5806e7946223e057ad7458a18dadceb0566f Mon Sep 17 00:00:00 2001 From: Alexey Fansky Date: Fri, 6 Feb 2015 16:25:44 -0800 Subject: Displaying tooltip in slot for touch devices (#15353) Change-Id: Ia2fce4dbfc205b44622557017afff19c4a2ef7df --- .../tests/components/TouchDevicesTooltip.java | 57 ++++++++++++++++++++++ 1 file changed, 57 insertions(+) create mode 100644 uitest/src/com/vaadin/tests/components/TouchDevicesTooltip.java (limited to 'uitest/src/com') 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..1a3b4cdda5 --- /dev/null +++ b/uitest/src/com/vaadin/tests/components/TouchDevicesTooltip.java @@ -0,0 +1,57 @@ +package com.vaadin.tests.components; + +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; + +public class TouchDevicesTooltip extends AbstractTestUI { + + @Override + protected void setup(VaadinRequest request) { + final Label errorLabel = new Label("No error"); + addComponent(errorLabel); + + TextField textField = new TextField("Value"); + textField.setConverter(new StringToIntegerConverter()); + textField.addValidator(new IntegerRangeValidator("incorrect value", 0, 100)); + textField.setImmediate(true); + textField.setValue("-5"); + addComponent(textField); + + TextField textField2 = new TextField("Value2"); + textField2.setConverter(new StringToIntegerConverter()); + textField2.addValidator(new IntegerRangeValidator("incorrect value2", 0, 100)); + textField2.setImmediate(true); + textField2.setValue("-5"); + addComponent(textField2); + } + + 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 15353; + } + + @Override + public String getDescription() { + return "Displaying error message in slot for touch devices"; + } +} -- cgit v1.2.3