]> source.dussan.org Git - vaadin-framework.git/commitdiff
#6911 Test
authorArtur Signell <artur.signell@itmill.com>
Mon, 2 May 2011 12:51:52 +0000 (12:51 +0000)
committerArtur Signell <artur.signell@itmill.com>
Mon, 2 May 2011 12:51:52 +0000 (12:51 +0000)
svn changeset:18585/svn branch:6.6

tests/src/com/vaadin/tests/components/label/LabelTooltip.java [new file with mode: 0644]

diff --git a/tests/src/com/vaadin/tests/components/label/LabelTooltip.java b/tests/src/com/vaadin/tests/components/label/LabelTooltip.java
new file mode 100644 (file)
index 0000000..aa1b357
--- /dev/null
@@ -0,0 +1,53 @@
+package com.vaadin.tests.components.label;\r
+\r
+import com.vaadin.terminal.ThemeResource;\r
+import com.vaadin.terminal.UserError;\r
+import com.vaadin.tests.components.TestBase;\r
+import com.vaadin.ui.GridLayout;\r
+import com.vaadin.ui.Label;\r
+import com.vaadin.ui.Layout;\r
+\r
+public class LabelTooltip extends TestBase {\r
+\r
+    @Override\r
+    protected void setup() {\r
+        addComponent(createLayout());\r
+    }\r
+\r
+    private static Layout createLayout() {\r
+        GridLayout layout = new GridLayout(2, 1);\r
+        layout.setCaption("Tooltips");\r
+        layout.setIcon(new ThemeResource("icons/blue/16/home.png"));\r
+        layout.setMargin(true);\r
+        layout.setSpacing(true);\r
+        layout.setWidth("400px");\r
+        layout.setColumnExpandRatio(0, 1);\r
+\r
+        layout.addComponent(new Label("Default"));\r
+        Label tooltip = new Label("Hover over me to see the tooltip");\r
+        tooltip.setSizeUndefined();\r
+        tooltip.setDescription("Default tooltip content");\r
+        layout.addComponent(tooltip);\r
+\r
+        layout.addComponent(new Label("Default /w error"));\r
+        tooltip = new Label("Hover over me to see the tooltip");\r
+        tooltip.setSizeUndefined();\r
+        tooltip.setDescription("Default tooltip content");\r
+        tooltip.setComponentError(new UserError(\r
+                "Error inside tooltip together with the regular tooltip message."));\r
+        layout.addComponent(tooltip);\r
+\r
+        return layout;\r
+    }\r
+\r
+    @Override\r
+    protected String getDescription() {\r
+        return "The lower label should have an error indicator. The upper should not.";\r
+    }\r
+\r
+    @Override\r
+    protected Integer getTicketNumber() {\r
+        return 6911;\r
+    }\r
+\r
+}\r