--- /dev/null
+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