+++ /dev/null
-<?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://localhost:8888/" />
-<title>TableItemDescriptionGeneratorTest</title>
-</head>
-<body>
-<table cellpadding="1" cellspacing="1" border="1">
-<thead>
-<tr><td rowspan="1" colspan="3">TableItemDescriptionGeneratorTest</td></tr>
-</thead><tbody>
-<tr>
- <td>open</td>
- <td>/run/TableItemDescriptionGeneratorTest?restartApplication</td>
- <td></td>
-</tr>
-<!--All on-->
-<!--Text tooltip-->
-<tr>
- <td>mouseMoveAt</td>
- <td>vaadin=runTableItemDescriptionGeneratorTest::PID_Stable/domChild[1]/domChild[0]/domChild[1]/domChild[0]/domChild[1]/domChild[0]/domChild[0]</td>
- <td>22,7</td>
-</tr>
-<tr>
- <td>waitForElementPresent</td>
- <td>vaadin=runTableItemDescriptionGeneratorTest::Root/VTooltip[0]</td>
- <td></td>
-</tr>
-<tr>
- <td>assertText</td>
- <td>vaadin=runTableItemDescriptionGeneratorTest::Root/VTooltip[0]/FlowPanel[0]/domChild[1]</td>
- <td>Cell description item 1,Text</td>
-</tr>
-<tr>
- <td>mouseMoveAt</td>
- <td>vaadin=runTableItemDescriptionGeneratorTest::/VVerticalLayout[0]/VOrderedLayout$Slot[1]/VVerticalLayout[0]/domChild[3]</td>
- <td>22,7</td>
-</tr>
-<tr>
- <td>pause</td>
- <td>1000</td>
- <td></td>
-</tr>
-<tr>
- <td>assertElementPositionLeft</td>
- <td>vaadin=runTableItemDescriptionGeneratorTest::Root/VTooltip[0]</td>
- <td>-5000</td>
-</tr>
-<!--Button tooltip-->
-<tr>
- <td>mouseMoveAt</td>
- <td>vaadin=runTableItemDescriptionGeneratorTest::PID_Stable/FocusableScrollPanel[0]/VScrollTable$VScrollTableBody[0]/VScrollTable$VScrollTableBody$VScrollTableRow[1]/VButton[0]/domChild[0]/domChild[0]</td>
- <td>22,7</td>
-</tr>
-<tr>
- <td>waitForElementPresent</td>
- <td>vaadin=runTableItemDescriptionGeneratorTest::Root/VTooltip[0]</td>
- <td></td>
-</tr>
-<tr>
- <td>assertText</td>
- <td>vaadin=runTableItemDescriptionGeneratorTest::Root/VTooltip[0]/FlowPanel[0]/domChild[1]</td>
- <td>Button 1 description</td>
-</tr>
-<tr>
- <td>mouseMoveAt</td>
- <td>vaadin=runTableItemDescriptionGeneratorTest::/VVerticalLayout[0]/VOrderedLayout$Slot[1]/VVerticalLayout[0]/domChild[3]</td>
- <td>22,7</td>
-</tr>
-<tr>
- <td>pause</td>
- <td>1000</td>
- <td></td>
-</tr>
-<tr>
- <td>assertElementPositionLeft</td>
- <td>vaadin=runTableItemDescriptionGeneratorTest::Root/VTooltip[0]</td>
- <td>-5000</td>
-</tr>
-<!--TextField tooltip-->
-<tr>
- <td>mouseMoveAt</td>
- <td>vaadin=runTableItemDescriptionGeneratorTest::PID_Stable/FocusableScrollPanel[0]/VScrollTable$VScrollTableBody[0]/VScrollTable$VScrollTableBody$VScrollTableRow[1]/VTextField[0]</td>
- <td>22,7</td>
-</tr>
-<tr>
- <td>waitForElementPresent</td>
- <td>vaadin=runTableItemDescriptionGeneratorTest::Root/VTooltip[0]</td>
- <td></td>
-</tr>
-<tr>
- <td>assertText</td>
- <td>vaadin=runTableItemDescriptionGeneratorTest::Root/VTooltip[0]/FlowPanel[0]/domChild[1]</td>
- <td>Textfield's own description</td>
-</tr>
-<tr>
- <td>mouseMoveAt</td>
- <td>vaadin=runTableItemDescriptionGeneratorTest::/VVerticalLayout[0]/VOrderedLayout$Slot[1]/VVerticalLayout[0]/domChild[3]</td>
- <td>22,7</td>
-</tr>
-<tr>
- <td>pause</td>
- <td>1000</td>
- <td></td>
-</tr>
-<tr>
- <td>assertElementPositionLeft</td>
- <td>vaadin=runTableItemDescriptionGeneratorTest::Root/VTooltip[0]</td>
- <td>-5000</td>
-</tr>
-<!--Cell and row tooltips-->
-<tr>
- <td>mouseClick</td>
- <td>vaadin=runTableItemDescriptionGeneratorTest::/VVerticalLayout[0]/VOrderedLayout$Slot[1]/VVerticalLayout[0]/VOrderedLayout$Slot[0]/VCheckBox[0]/domChild[0]</td>
- <td>12,6</td>
-</tr>
-<!--Text tooltip-->
-<tr>
- <td>mouseMoveAt</td>
- <td>vaadin=runTableItemDescriptionGeneratorTest::PID_Stable/domChild[1]/domChild[0]/domChild[1]/domChild[0]/domChild[1]/domChild[0]/domChild[0]</td>
- <td>22,7</td>
-</tr>
-<tr>
- <td>waitForElementPresent</td>
- <td>vaadin=runTableItemDescriptionGeneratorTest::Root/VTooltip[0]</td>
- <td></td>
-</tr>
-<tr>
- <td>assertText</td>
- <td>vaadin=runTableItemDescriptionGeneratorTest::Root/VTooltip[0]/FlowPanel[0]/domChild[1]</td>
- <td>Cell description item 1,Text</td>
-</tr>
-<tr>
- <td>mouseMoveAt</td>
- <td>vaadin=runTableItemDescriptionGeneratorTest::/VVerticalLayout[0]/VOrderedLayout$Slot[1]/VVerticalLayout[0]/domChild[3]</td>
- <td>22,7</td>
-</tr>
-<tr>
- <td>pause</td>
- <td>1000</td>
- <td></td>
-</tr>
-<tr>
- <td>assertElementPositionLeft</td>
- <td>vaadin=runTableItemDescriptionGeneratorTest::Root/VTooltip[0]</td>
- <td>-5000</td>
-</tr>
-<!--Button tooltip-->
-<tr>
- <td>mouseMoveAt</td>
- <td>vaadin=runTableItemDescriptionGeneratorTest::PID_Stable/FocusableScrollPanel[0]/VScrollTable$VScrollTableBody[0]/VScrollTable$VScrollTableBody$VScrollTableRow[1]/VButton[0]/domChild[0]/domChild[0]</td>
- <td>22,7</td>
-</tr>
-<tr>
- <td>waitForElementPresent</td>
- <td>vaadin=runTableItemDescriptionGeneratorTest::Root/VTooltip[0]</td>
- <td></td>
-</tr>
-<tr>
- <td>assertText</td>
- <td>vaadin=runTableItemDescriptionGeneratorTest::Root/VTooltip[0]/FlowPanel[0]/domChild[1]</td>
- <td>Cell description item 1,Component</td>
-</tr>
-<tr>
- <td>mouseMoveAt</td>
- <td>vaadin=runTableItemDescriptionGeneratorTest::/VVerticalLayout[0]/VOrderedLayout$Slot[1]/VVerticalLayout[0]/domChild[3]</td>
- <td>22,7</td>
-</tr>
-<tr>
- <td>pause</td>
- <td>1000</td>
- <td></td>
-</tr>
-<tr>
- <td>assertElementPositionLeft</td>
- <td>vaadin=runTableItemDescriptionGeneratorTest::Root/VTooltip[0]</td>
- <td>-5000</td>
-</tr>
-<!--TextField tooltip-->
-<tr>
- <td>mouseMoveAt</td>
- <td>vaadin=runTableItemDescriptionGeneratorTest::PID_Stable/FocusableScrollPanel[0]/VScrollTable$VScrollTableBody[0]/VScrollTable$VScrollTableBody$VScrollTableRow[1]/VTextField[0]</td>
- <td>22,7</td>
-</tr>
-<tr>
- <td>waitForElementPresent</td>
- <td>vaadin=runTableItemDescriptionGeneratorTest::Root/VTooltip[0]</td>
- <td></td>
-</tr>
-<tr>
- <td>assertText</td>
- <td>vaadin=runTableItemDescriptionGeneratorTest::Root/VTooltip[0]/FlowPanel[0]/domChild[1]</td>
- <td>Cell description item 1,Generated component</td>
-</tr>
-<tr>
- <td>mouseMoveAt</td>
- <td>vaadin=runTableItemDescriptionGeneratorTest::/VVerticalLayout[0]/VOrderedLayout$Slot[1]/VVerticalLayout[0]/domChild[3]</td>
- <td>22,7</td>
-</tr>
-<tr>
- <td>pause</td>
- <td>1000</td>
- <td></td>
-</tr>
-<tr>
- <td>assertElementPositionLeft</td>
- <td>vaadin=runTableItemDescriptionGeneratorTest::Root/VTooltip[0]</td>
- <td>-5000</td>
-</tr>
-<!--Row and Component tooltips-->
-<tr>
- <td>mouseClick</td>
- <td>vaadin=runTableItemDescriptionGeneratorTest::/VVerticalLayout[0]/VOrderedLayout$Slot[1]/VVerticalLayout[0]/VOrderedLayout$Slot[0]/VCheckBox[0]/domChild[0]</td>
- <td>7,8</td>
-</tr>
-<tr>
- <td>mouseClick</td>
- <td>vaadin=runTableItemDescriptionGeneratorTest::/VVerticalLayout[0]/VOrderedLayout$Slot[1]/VVerticalLayout[0]/VOrderedLayout$Slot[1]/VCheckBox[0]/domChild[0]</td>
- <td>7,5</td>
-</tr>
-<!--Text tooltip-->
-<tr>
- <td>mouseMoveAt</td>
- <td>vaadin=runTableItemDescriptionGeneratorTest::PID_Stable/domChild[1]/domChild[0]/domChild[1]/domChild[0]/domChild[1]/domChild[0]/domChild[0]</td>
- <td>22,7</td>
-</tr>
-<tr>
- <td>waitForElementPresent</td>
- <td>vaadin=runTableItemDescriptionGeneratorTest::Root/VTooltip[0]</td>
- <td></td>
-</tr>
-<tr>
- <td>assertText</td>
- <td>vaadin=runTableItemDescriptionGeneratorTest::Root/VTooltip[0]/FlowPanel[0]/domChild[1]</td>
- <td>Row description item 1</td>
-</tr>
-<tr>
- <td>mouseMoveAt</td>
- <td>vaadin=runTableItemDescriptionGeneratorTest::/VVerticalLayout[0]/VOrderedLayout$Slot[1]/VVerticalLayout[0]/domChild[3]</td>
- <td>22,7</td>
-</tr>
-<tr>
- <td>pause</td>
- <td>1000</td>
- <td></td>
-</tr>
-<tr>
- <td>assertElementPositionLeft</td>
- <td>vaadin=runTableItemDescriptionGeneratorTest::Root/VTooltip[0]</td>
- <td>-5000</td>
-</tr>
-<!--Button tooltip-->
-<tr>
- <td>mouseMoveAt</td>
- <td>vaadin=runTableItemDescriptionGeneratorTest::PID_Stable/FocusableScrollPanel[0]/VScrollTable$VScrollTableBody[0]/VScrollTable$VScrollTableBody$VScrollTableRow[1]/VButton[0]/domChild[0]/domChild[0]</td>
- <td>22,7</td>
-</tr>
-<tr>
- <td>waitForElementPresent</td>
- <td>vaadin=runTableItemDescriptionGeneratorTest::Root/VTooltip[0]</td>
- <td></td>
-</tr>
-<tr>
- <td>assertText</td>
- <td>vaadin=runTableItemDescriptionGeneratorTest::Root/VTooltip[0]/FlowPanel[0]/domChild[1]</td>
- <td>Button 1 description</td>
-</tr>
-<tr>
- <td>mouseMoveAt</td>
- <td>vaadin=runTableItemDescriptionGeneratorTest::/VVerticalLayout[0]/VOrderedLayout$Slot[1]/VVerticalLayout[0]/domChild[3]</td>
- <td>22,7</td>
-</tr>
-<tr>
- <td>pause</td>
- <td>1000</td>
- <td></td>
-</tr>
-<tr>
- <td>assertElementPositionLeft</td>
- <td>vaadin=runTableItemDescriptionGeneratorTest::Root/VTooltip[0]</td>
- <td>-5000</td>
-</tr>
-<!--TextField tooltip-->
-<tr>
- <td>mouseMoveAt</td>
- <td>vaadin=runTableItemDescriptionGeneratorTest::PID_Stable/FocusableScrollPanel[0]/VScrollTable$VScrollTableBody[0]/VScrollTable$VScrollTableBody$VScrollTableRow[1]/VTextField[0]</td>
- <td>22,7</td>
-</tr>
-<tr>
- <td>waitForElementPresent</td>
- <td>vaadin=runTableItemDescriptionGeneratorTest::Root/VTooltip[0]</td>
- <td></td>
-</tr>
-<tr>
- <td>assertText</td>
- <td>vaadin=runTableItemDescriptionGeneratorTest::Root/VTooltip[0]/FlowPanel[0]/domChild[1]</td>
- <td>Textfield's own description</td>
-</tr>
-<tr>
- <td>mouseMoveAt</td>
- <td>vaadin=runTableItemDescriptionGeneratorTest::/VVerticalLayout[0]/VOrderedLayout$Slot[1]/VVerticalLayout[0]/domChild[3]</td>
- <td>22,7</td>
-</tr>
-<tr>
- <td>pause</td>
- <td>1000</td>
- <td></td>
-</tr>
-<tr>
- <td>assertElementPositionLeft</td>
- <td>vaadin=runTableItemDescriptionGeneratorTest::Root/VTooltip[0]</td>
- <td>-5000</td>
-</tr>
-<!--Row tooltips-->
-<tr>
- <td>mouseClick</td>
- <td>vaadin=runTableItemDescriptionGeneratorTest::/VVerticalLayout[0]/VOrderedLayout$Slot[1]/VVerticalLayout[0]/VOrderedLayout$Slot[0]/VCheckBox[0]/domChild[0]</td>
- <td>7,8</td>
-</tr>
-<!--Text tooltip-->
-<tr>
- <td>mouseMoveAt</td>
- <td>vaadin=runTableItemDescriptionGeneratorTest::PID_Stable/domChild[1]/domChild[0]/domChild[1]/domChild[0]/domChild[1]/domChild[0]/domChild[0]</td>
- <td>22,7</td>
-</tr>
-<tr>
- <td>waitForElementPresent</td>
- <td>vaadin=runTableItemDescriptionGeneratorTest::Root/VTooltip[0]</td>
- <td></td>
-</tr>
-<tr>
- <td>assertText</td>
- <td>vaadin=runTableItemDescriptionGeneratorTest::Root/VTooltip[0]/FlowPanel[0]/domChild[1]</td>
- <td>Row description item 1</td>
-</tr>
-<tr>
- <td>mouseMoveAt</td>
- <td>vaadin=runTableItemDescriptionGeneratorTest::/VVerticalLayout[0]/VOrderedLayout$Slot[1]/VVerticalLayout[0]/domChild[3]</td>
- <td>22,7</td>
-</tr>
-<tr>
- <td>pause</td>
- <td>1000</td>
- <td></td>
-</tr>
-<tr>
- <td>assertElementPositionLeft</td>
- <td>vaadin=runTableItemDescriptionGeneratorTest::Root/VTooltip[0]</td>
- <td>-5000</td>
-</tr>
-<!--Button tooltip-->
-<tr>
- <td>mouseMoveAt</td>
- <td>vaadin=runTableItemDescriptionGeneratorTest::PID_Stable/FocusableScrollPanel[0]/VScrollTable$VScrollTableBody[0]/VScrollTable$VScrollTableBody$VScrollTableRow[1]/VButton[0]/domChild[0]/domChild[0]</td>
- <td>22,7</td>
-</tr>
-<tr>
- <td>waitForElementPresent</td>
- <td>vaadin=runTableItemDescriptionGeneratorTest::Root/VTooltip[0]</td>
- <td></td>
-</tr>
-<tr>
- <td>assertText</td>
- <td>vaadin=runTableItemDescriptionGeneratorTest::Root/VTooltip[0]/FlowPanel[0]/domChild[1]</td>
- <td>Row description item 1</td>
-</tr>
-<tr>
- <td>mouseMoveAt</td>
- <td>vaadin=runTableItemDescriptionGeneratorTest::/VVerticalLayout[0]/VOrderedLayout$Slot[1]/VVerticalLayout[0]/domChild[3]</td>
- <td>22,7</td>
-</tr>
-<tr>
- <td>pause</td>
- <td>1000</td>
- <td></td>
-</tr>
-<tr>
- <td>assertElementPositionLeft</td>
- <td>vaadin=runTableItemDescriptionGeneratorTest::Root/VTooltip[0]</td>
- <td>-5000</td>
-</tr>
-<!--TextField tooltip-->
-<tr>
- <td>mouseMoveAt</td>
- <td>vaadin=runTableItemDescriptionGeneratorTest::PID_Stable/FocusableScrollPanel[0]/VScrollTable$VScrollTableBody[0]/VScrollTable$VScrollTableBody$VScrollTableRow[1]/VTextField[0]</td>
- <td>22,7</td>
-</tr>
-<tr>
- <td>waitForElementPresent</td>
- <td>vaadin=runTableItemDescriptionGeneratorTest::Root/VTooltip[0]</td>
- <td></td>
-</tr>
-<tr>
- <td>assertText</td>
- <td>vaadin=runTableItemDescriptionGeneratorTest::Root/VTooltip[0]/FlowPanel[0]/domChild[1]</td>
- <td>Row description item 1</td>
-</tr>
-<tr>
- <td>mouseMoveAt</td>
- <td>vaadin=runTableItemDescriptionGeneratorTest::/VVerticalLayout[0]/VOrderedLayout$Slot[1]/VVerticalLayout[0]/domChild[3]</td>
- <td>22,7</td>
-</tr>
-<tr>
- <td>pause</td>
- <td>1000</td>
- <td></td>
-</tr>
-<tr>
- <td>assertElementPositionLeft</td>
- <td>vaadin=runTableItemDescriptionGeneratorTest::Root/VTooltip[0]</td>
- <td>-5000</td>
-</tr>
-
-</tbody></table>
-</body>
-</html>
+++ /dev/null
-package com.vaadin.tests.components.table;
-
-import com.vaadin.data.Container;
-import com.vaadin.data.Item;
-import com.vaadin.data.Property.ValueChangeEvent;
-import com.vaadin.data.Property.ValueChangeListener;
-import com.vaadin.data.util.IndexedContainer;
-import com.vaadin.tests.components.TestBase;
-import com.vaadin.ui.AbstractSelect.ItemDescriptionGenerator;
-import com.vaadin.ui.Button;
-import com.vaadin.ui.CheckBox;
-import com.vaadin.ui.Component;
-import com.vaadin.ui.Table;
-import com.vaadin.ui.TextField;
-
-public class TableItemDescriptionGeneratorTest extends TestBase {
-
- private final String TEXT_PROPERTY_ID = "Text";
- private final String GEN_WIDGET_PROPERTY_ID = "Generated component";
- private final String WIDGET_PROPERTY_ID = "Component";
- private CheckBox componentDescription;
- private CheckBox tableCellItemDescription;
- private CheckBox tableRowItemDescription;
-
- @Override
- protected void setup() {
- final Table table = createTable();
- table.setId("table");
- componentDescription = new CheckBox("Tooltip on components");
- componentDescription.addValueChangeListener(new ValueChangeListener() {
-
- @Override
- public void valueChange(ValueChangeEvent event) {
- table.setContainerDataSource(createContainer(componentDescription
- .getValue()));
- }
- });
- componentDescription.setImmediate(true);
- componentDescription.setValue(true);
- tableCellItemDescription = new CheckBox("Tooltip on table cells");
- tableCellItemDescription
- .addValueChangeListener(new ValueChangeListener() {
-
- @Override
- public void valueChange(ValueChangeEvent event) {
- table.refreshRowCache();
- }
- });
- tableCellItemDescription.setImmediate(true);
- tableCellItemDescription.setValue(true);
-
- tableRowItemDescription = new CheckBox("Tooltip on table Rows");
- tableRowItemDescription
- .addValueChangeListener(new ValueChangeListener() {
-
- @Override
- public void valueChange(ValueChangeEvent event) {
- table.refreshRowCache();
- }
- });
- tableRowItemDescription.setImmediate(true);
- tableRowItemDescription.setValue(true);
-
- addComponent(componentDescription);
- addComponent(tableCellItemDescription);
- addComponent(tableRowItemDescription);
- addComponent(table);
-
- table.setItemDescriptionGenerator(new ItemDescriptionGenerator() {
- @Override
- public String generateDescription(Component source, Object itemId,
- Object propertyId) {
- if (propertyId == null && tableRowItemDescription.getValue()) {
- return "Row description " + itemId;
- } else if (tableCellItemDescription.getValue()) {
- return "Cell description " + itemId + "," + propertyId;
- }
- return null;
- }
- });
-
- table.addGeneratedColumn(GEN_WIDGET_PROPERTY_ID,
- new Table.ColumnGenerator() {
-
- @Override
- public Component generateCell(Table source, Object itemId,
- Object columnId) {
- TextField lbl = new TextField();
- if (componentDescription.getValue()) {
- lbl.setDescription("Textfield's own description");
- }
- return lbl;
- }
- });
-
- }
-
- protected Table createTable() {
- return new Table();
- }
-
- @Override
- protected String getDescription() {
- return "Cells and rows should have tooltips";
- }
-
- @Override
- protected Integer getTicketNumber() {
- return 5414;
- }
-
- private Container createContainer(boolean description) {
- IndexedContainer container = new IndexedContainer();
- container.addContainerProperty(TEXT_PROPERTY_ID, String.class, "");
- container.addContainerProperty(WIDGET_PROPERTY_ID, Component.class,
- null);
- // container.addContainerProperty(COLUMN3_PROPERTY_ID, String.class,
- // "");
-
- for (int i = 0; i < 5; i++) {
- Item item = container.addItem("item " + i);
- item.getItemProperty(TEXT_PROPERTY_ID).setValue("Text " + i);
- Button b = new Button("Button " + i);
- if (description) {
- b.setDescription("Button " + i + " description");
- }
- item.getItemProperty(WIDGET_PROPERTY_ID).setValue(b);
- // item.getItemProperty(COLUMN3_PROPERTY_ID).setValue("last" + i);
- }
-
- return container;
- }
-
-}
--- /dev/null
+package com.vaadin.tests.components.table;
+
+import com.vaadin.data.Container;
+import com.vaadin.data.Item;
+import com.vaadin.data.Property.ValueChangeEvent;
+import com.vaadin.data.Property.ValueChangeListener;
+import com.vaadin.data.util.IndexedContainer;
+import com.vaadin.server.VaadinRequest;
+import com.vaadin.tests.components.AbstractTestUI;
+import com.vaadin.ui.AbstractSelect.ItemDescriptionGenerator;
+import com.vaadin.ui.Button;
+import com.vaadin.ui.CheckBox;
+import com.vaadin.ui.Component;
+import com.vaadin.ui.Table;
+import com.vaadin.ui.TextField;
+
+public class TableItemDescriptionGeneratorUI extends AbstractTestUI {
+
+ private final String TEXT_PROPERTY_ID = "Text";
+ private final String GEN_WIDGET_PROPERTY_ID = "Generated component";
+ private final String WIDGET_PROPERTY_ID = "Component";
+ private CheckBox componentDescription;
+ private CheckBox tableCellItemDescription;
+ private CheckBox tableRowItemDescription;
+
+ @Override
+ protected void setup(VaadinRequest request) {
+ final Table table = createTable();
+ table.setId("table");
+ componentDescription = new CheckBox("Tooltip on components");
+ componentDescription.addValueChangeListener(new ValueChangeListener() {
+
+ @Override
+ public void valueChange(ValueChangeEvent event) {
+ table.setContainerDataSource(createContainer(componentDescription
+ .getValue()));
+ }
+ });
+ componentDescription.setImmediate(true);
+ componentDescription.setValue(true);
+ tableCellItemDescription = new CheckBox("Tooltip on table cells");
+ tableCellItemDescription
+ .addValueChangeListener(new ValueChangeListener() {
+
+ @Override
+ public void valueChange(ValueChangeEvent event) {
+ table.refreshRowCache();
+ }
+ });
+ tableCellItemDescription.setImmediate(true);
+ tableCellItemDescription.setValue(true);
+
+ tableRowItemDescription = new CheckBox("Tooltip on table Rows");
+ tableRowItemDescription
+ .addValueChangeListener(new ValueChangeListener() {
+
+ @Override
+ public void valueChange(ValueChangeEvent event) {
+ table.refreshRowCache();
+ }
+ });
+ tableRowItemDescription.setImmediate(true);
+ tableRowItemDescription.setValue(true);
+
+ addComponent(componentDescription);
+ addComponent(tableCellItemDescription);
+ addComponent(tableRowItemDescription);
+ addComponent(table);
+
+ table.setItemDescriptionGenerator(new ItemDescriptionGenerator() {
+ @Override
+ public String generateDescription(Component source, Object itemId,
+ Object propertyId) {
+ if (propertyId == null && tableRowItemDescription.getValue()) {
+ return "Row description " + itemId;
+ } else if (tableCellItemDescription.getValue()) {
+ return "Cell description " + itemId + ", " + propertyId;
+ }
+ return null;
+ }
+ });
+
+ table.addGeneratedColumn(GEN_WIDGET_PROPERTY_ID,
+ new Table.ColumnGenerator() {
+
+ @Override
+ public Component generateCell(Table source, Object itemId,
+ Object columnId) {
+ TextField lbl = new TextField();
+ if (componentDescription.getValue()) {
+ lbl.setDescription("Textfield's own description");
+ }
+ return lbl;
+ }
+ });
+
+ }
+
+ protected Table createTable() {
+ return new Table();
+ }
+
+ @Override
+ protected String getTestDescription() {
+ return "Cells and rows should have tooltips";
+ }
+
+ @Override
+ protected Integer getTicketNumber() {
+ return 5414;
+ }
+
+ @SuppressWarnings("unchecked")
+ private Container createContainer(boolean description) {
+ IndexedContainer container = new IndexedContainer();
+ container.addContainerProperty(TEXT_PROPERTY_ID, String.class, "");
+ container.addContainerProperty(WIDGET_PROPERTY_ID, Component.class,
+ null);
+
+ for (int i = 0; i < 5; i++) {
+ Item item = container.addItem("item " + i);
+ item.getItemProperty(TEXT_PROPERTY_ID).setValue("Text " + i);
+ Button b = new Button("Button " + i);
+ if (description) {
+ b.setDescription("Button " + i + " description");
+ }
+ item.getItemProperty(WIDGET_PROPERTY_ID).setValue(b);
+ }
+
+ return container;
+ }
+
+}
--- /dev/null
+/*
+ * Copyright 2000-2014 Vaadin Ltd.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License"); you may not
+ * use this file except in compliance with the License. You may obtain a copy of
+ * the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
+ * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
+ * License for the specific language governing permissions and limitations under
+ * the License.
+ */
+package com.vaadin.tests.components.table;
+
+import static org.junit.Assert.assertEquals;
+
+import java.util.List;
+
+import org.junit.Test;
+import org.openqa.selenium.interactions.Actions;
+
+import com.vaadin.testbench.By;
+import com.vaadin.testbench.TestBenchElement;
+import com.vaadin.testbench.elements.CheckBoxElement;
+import com.vaadin.testbench.elements.TableElement;
+import com.vaadin.tests.tb3.TooltipTest;
+
+/**
+ * Tests Table tooltips with various settings.
+ *
+ * @author Vaadin Ltd
+ */
+public class TableItemDescriptionGeneratorUITest extends TooltipTest {
+
+ @Test
+ public void testDescriptions() throws Exception {
+ openTestURL();
+
+ checkTooltipNotPresent();
+
+ TableElement table = $(TableElement.class).first();
+ List<CheckBoxElement> checkboxes = $(CheckBoxElement.class).all();
+ assertEquals(3, checkboxes.size());
+
+ // check text description
+ TestBenchElement cell_1_0 = table.getCell(1, 0);
+ cell_1_0.showTooltip();
+ checkTooltip("Cell description item 1, Text");
+
+ // move somewhere without a description
+ checkboxes.get(2).showTooltip();
+ checkTooltipNotPresent();
+
+ // check button description
+ TestBenchElement cell_1_1 = table.getCell(1, 1);
+ cell_1_1.showTooltip();
+ checkTooltip("Button 1 description");
+
+ // move somewhere without a description
+ checkboxes.get(2).showTooltip();
+ checkTooltipNotPresent();
+
+ // check textfield's description
+ TestBenchElement cell_1_2 = table.getCell(1, 2);
+ cell_1_2.showTooltip();
+ checkTooltip("Textfield's own description");
+
+ // move somewhere without a description
+ checkboxes.get(2).showTooltip();
+ checkTooltipNotPresent();
+
+ // uncheck component tooltips
+ checkboxes.get(0).findElement(By.tagName("input")).click();
+
+ // check text description
+ cell_1_0 = table.getCell(1, 0);
+ cell_1_0.showTooltip();
+ checkTooltip("Cell description item 1, Text");
+
+ // move somewhere without a description
+ checkboxes.get(2).showTooltip();
+ checkTooltipNotPresent();
+
+ // check button description
+ cell_1_1 = table.getCell(1, 1);
+ cell_1_1.showTooltip();
+ checkTooltip("Cell description item 1, Component");
+
+ // move somewhere without a description
+ new Actions(getDriver()).moveToElement(checkboxes.get(2)).perform();
+ sleep(1000);
+ checkTooltipNotPresent();
+
+ // check textfield's description
+ cell_1_2 = table.getCell(1, 2);
+ cell_1_2.showTooltip();
+ checkTooltip("Cell description item 1, Generated component");
+
+ // move somewhere without a description
+ checkboxes.get(2).showTooltip();
+ checkTooltipNotPresent();
+
+ // check component tooltips
+ checkboxes.get(0).findElement(By.tagName("input")).click();
+ // uncheck cell tooltips
+ checkboxes.get(1).findElement(By.tagName("input")).click();
+
+ // check text description
+ cell_1_0 = table.getCell(1, 0);
+ cell_1_0.showTooltip();
+ checkTooltip("Row description item 1");
+
+ // move somewhere without a description
+ checkboxes.get(2).showTooltip();
+ checkTooltipNotPresent();
+
+ // check button description
+ cell_1_1 = table.getCell(1, 1);
+ cell_1_1.showTooltip();
+ checkTooltip("Button 1 description");
+
+ // move somewhere without a description
+ checkboxes.get(2).showTooltip();
+ checkTooltipNotPresent();
+
+ // check textfield's description
+ cell_1_2 = table.getCell(1, 2);
+ cell_1_2.showTooltip();
+ checkTooltip("Textfield's own description");
+
+ // move somewhere without a description
+ checkboxes.get(2).showTooltip();
+ checkTooltipNotPresent();
+
+ // uncheck component tooltips
+ checkboxes.get(0).findElement(By.tagName("input")).click();
+
+ // check text description
+ cell_1_0 = table.getCell(1, 0);
+ cell_1_0.showTooltip();
+ checkTooltip("Row description item 1");
+
+ // move somewhere without a description
+ checkboxes.get(2).showTooltip();
+ checkTooltipNotPresent();
+
+ // check button description
+ cell_1_1 = table.getCell(1, 1);
+ cell_1_1.showTooltip();
+ checkTooltip("Row description item 1");
+
+ // move somewhere without a description
+ checkboxes.get(2).showTooltip();
+ checkTooltipNotPresent();
+
+ // check textfield's description
+ cell_1_2 = table.getCell(1, 2);
+ cell_1_2.showTooltip();
+ checkTooltip("Row description item 1");
+
+ // move somewhere without a description
+ checkboxes.get(2).showTooltip();
+ checkTooltipNotPresent();
+ }
+
+ @Test
+ public void testPosition() throws Exception {
+ openTestURL();
+
+ TableElement table = $(TableElement.class).first();
+ List<CheckBoxElement> checkboxes = $(CheckBoxElement.class).all();
+ assertEquals(3, checkboxes.size());
+
+ TestBenchElement cell_3_0 = table.getCell(3, 0);
+
+ // move to the center of the cell
+ new Actions(getDriver()).moveToElement(cell_3_0).perform();
+ sleep(1000);
+
+ // ensure the tooltip is present
+ checkTooltip("Cell description item 3, Text");
+ clearTooltip();
+
+ // move outside the cell
+ new Actions(getDriver()).moveToElement(checkboxes.get(2)).perform();
+
+ // move to the corner of the cell
+ new Actions(getDriver()).moveToElement(cell_3_0, 0, 0).perform();
+ sleep(1000);
+
+ // ensure the tooltip is present
+ checkTooltip("Cell description item 3, Text");
+ clearTooltip();
+
+ // uncheck cell tooltips
+ checkboxes.get(1).findElement(By.tagName("input")).click();
+
+ TestBenchElement cell_1_1 = table.getCell(1, 1);
+
+ // move to the center of the cell
+ new Actions(getDriver()).moveToElement(cell_1_1).perform();
+ sleep(1000);
+
+ // ensure the tooltip is present
+ checkTooltip("Button 1 description");
+ clearTooltip();
+
+ // move to the corner of the element, outside of the button
+ new Actions(getDriver()).moveToElement(cell_1_1, 0, 0).perform();
+ sleep(1000);
+
+ // ensure the tooltip is present
+ checkTooltip("Row description item 1");
+ clearTooltip();
+
+ // check cell tooltips
+ checkboxes.get(1).findElement(By.tagName("input")).click();
+
+ TestBenchElement cell_4_2 = table.getCell(4, 2);
+
+ // move to the center of the cell
+ new Actions(getDriver()).moveToElement(cell_4_2).perform();
+ sleep(1000);
+
+ // ensure the tooltip is present
+ checkTooltip("Textfield's own description");
+ clearTooltip();
+
+ // move to the corner of the element, outside of the textfield
+ new Actions(getDriver()).moveToElement(cell_4_2, 0, 0).perform();
+ sleep(1000);
+
+ // ensure the tooltip is present
+ checkTooltip("Cell description item 4, Generated component");
+ clearTooltip();
+ }
+
+}
+++ /dev/null
-<?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="" />
-<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.table.TableItemDescriptionGeneratorTest?restartApplication</td>
- <td></td>
-</tr>
-<tr>
- <td>mouseMove</td>
- <td>vaadin=runcomvaadintestscomponentstableTableItemDescriptionGeneratorTest::PID_Stable/domChild[1]/domChild[0]/domChild[1]/domChild[0]/domChild[3]/domChild[0]/domChild[0]</td>
- <td>57,5</td>
-</tr>
-<tr>
- <td>pause</td>
- <td>1000</td>
- <td>1000</td>
-</tr>
-<tr>
- <td>assertText</td>
- <td>vaadin=runcomvaadintestscomponentstableTableItemDescriptionGeneratorTest::Root/VTooltip[0]/FlowPanel[0]/domChild[1]</td>
- <td>Cell description item 3,Text</td>
-</tr>
-<tr>
- <td>mouseClick</td>
- <td>vaadin=runcomvaadintestscomponentstableTableItemDescriptionGeneratorTest::/VVerticalLayout[0]/ChildComponentContainer[1]/VVerticalLayout[0]/domChild[0]/domChild[0]</td>
- <td>810,153</td>
-</tr>
-<tr>
- <td>mouseClick</td>
- <td>vaadin=runcomvaadintestscomponentstableTableItemDescriptionGeneratorTest::/VVerticalLayout[0]/VOrderedLayout$Slot[1]/VVerticalLayout[0]/domChild[3]</td>
- <td>355,350</td>
-</tr>
-<tr>
- <td>drag</td>
- <td>vaadin=runcomvaadintestscomponentstableTableItemDescriptionGeneratorTest::/VVerticalLayout[0]/VOrderedLayout$Slot[1]/VVerticalLayout[0]/domChild[3]</td>
- <td>822,249</td>
-</tr>
-<tr>
- <td>drop</td>
- <td>vaadin=runcomvaadintestscomponentstableTableItemDescriptionGeneratorTest::PID_Stable/domChild[1]/domChild[0]/domChild[1]/domChild[0]/domChild[1]/domChild[1]</td>
- <td>90,12</td>
-</tr>
-<tr>
- <td>mouseMove</td>
- <td>vaadin=runcomvaadintestscomponentstableTableItemDescriptionGeneratorTest::PID_Stable/domChild[1]/domChild[0]/domChild[1]/domChild[0]/domChild[1]</td>
- <td>57,12</td>
-</tr>
-<tr>
- <td>pause</td>
- <td>1000</td>
- <td>1000</td>
-</tr>
-<tr>
- <td>assertText</td>
- <td>vaadin=runcomvaadintestscomponentstableTableItemDescriptionGeneratorTest::Root/VTooltip[0]/FlowPanel[0]/domChild[1]</td>
- <td>Row description item 1</td>
-</tr>
-<tr>
- <td>mouseClick</td>
- <td>vaadin=runcomvaadintestscomponentstableTableItemDescriptionGeneratorTest::/VVerticalLayout[0]/ChildComponentContainer[1]/VVerticalLayout[0]/domChild[0]/domChild[0]</td>
- <td>1011,283</td>
-</tr>
-<tr>
- <td>mouseMove</td>
- <td>vaadin=runcomvaadintestscomponentstableTableItemDescriptionGeneratorTest::PID_Stable/FocusableScrollPanel[0]/VScrollTable$VScrollTableBody[0]/VScrollTable$VScrollTableBody$VScrollTableRow[4]/VTextField[0]</td>
- <td>58,10</td>
-</tr>
-<tr>
- <td>pause</td>
- <td>1000</td>
- <td>1000</td>
-</tr>
-<tr>
- <td>assertText</td>
- <td>vaadin=runcomvaadintestscomponentstableTableItemDescriptionGeneratorTest::Root/VTooltip[0]/FlowPanel[0]/domChild[1]</td>
- <td>Textfield's own description</td>
-</tr>
-</tbody></table>
-</body>
-</html>
+++ /dev/null
-<?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:8888/" />
-<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/TreeTableItemDescriptionGeneratorTest?restartApplication</td>
- <td></td>
-</tr>
-<!--All on-->
-<!--Text tooltip-->
-<tr>
- <td>mouseMoveAt</td>
- <td>vaadin=runTreeTableItemDescriptionGeneratorTest::PID_Stable/domChild[1]/domChild[0]/domChild[1]/domChild[0]/domChild[1]/domChild[0]/domChild[0]</td>
- <td>22,7</td>
-</tr>
-<tr>
- <td>waitForElementPresent</td>
- <td>vaadin=runTreeTableItemDescriptionGeneratorTest::Root/VTooltip[0]</td>
- <td></td>
-</tr>
-<tr>
- <td>assertText</td>
- <td>vaadin=runTreeTableItemDescriptionGeneratorTest::Root/VTooltip[0]/FlowPanel[0]/domChild[1]</td>
- <td>Cell description item 1,Text</td>
-</tr>
-<tr>
- <td>mouseMoveAt</td>
- <td>vaadin=runTreeTableItemDescriptionGeneratorTest::/VVerticalLayout[0]/VOrderedLayout$Slot[1]/VVerticalLayout[0]/domChild[3]</td>
- <td>22,7</td>
-</tr>
-<tr>
- <td>waitForElementNotPresent</td>
- <td>vaadin=runTreeTableItemDescriptionGeneratorTest::Root/VTooltip[0]</td>
- <td></td>
-</tr>
-<!--Button tooltip-->
-<tr>
- <td>mouseMoveAt</td>
- <td>vaadin=runTreeTableItemDescriptionGeneratorTest::PID_Stable/FocusableScrollPanel[0]/VTreeTable$VTreeTableScrollBody[0]/VTreeTable$VTreeTableScrollBody$VTreeTableRow[1]/VButton[0]/domChild[0]/domChild[0]</td>
- <td>22,7</td>
-</tr>
-<tr>
- <td>waitForElementPresent</td>
- <td>vaadin=runTreeTableItemDescriptionGeneratorTest::Root/VTooltip[0]</td>
- <td></td>
-</tr>
-<tr>
- <td>assertText</td>
- <td>vaadin=runTreeTableItemDescriptionGeneratorTest::Root/VTooltip[0]/FlowPanel[0]/domChild[1]</td>
- <td>Button 1 description</td>
-</tr>
-<tr>
- <td>mouseMoveAt</td>
- <td>vaadin=runTreeTableItemDescriptionGeneratorTest::/VVerticalLayout[0]/VOrderedLayout$Slot[1]/VVerticalLayout[0]/domChild[3]</td>
- <td>22,7</td>
-</tr>
-<tr>
- <td>waitForElementNotPresent</td>
- <td>vaadin=runTreeTableItemDescriptionGeneratorTest::Root/VTooltip[0]</td>
- <td></td>
-</tr>
-<!--TextField tooltip-->
-<tr>
- <td>mouseMoveAt</td>
- <td>vaadin=runTreeTableItemDescriptionGeneratorTest::PID_Stable/FocusableScrollPanel[0]/VTreeTable$VTreeTableScrollBody[0]/VTreeTable$VTreeTableScrollBody$VTreeTableRow[1]/VTextField[0]</td>
- <td>22,7</td>
-</tr>
-<tr>
- <td>waitForElementPresent</td>
- <td>vaadin=runTreeTableItemDescriptionGeneratorTest::Root/VTooltip[0]</td>
- <td></td>
-</tr>
-<tr>
- <td>assertText</td>
- <td>vaadin=runTreeTableItemDescriptionGeneratorTest::Root/VTooltip[0]/FlowPanel[0]/domChild[1]</td>
- <td>Textfield's own description</td>
-</tr>
-<tr>
- <td>mouseMoveAt</td>
- <td>vaadin=runTreeTableItemDescriptionGeneratorTest::/VVerticalLayout[0]/VOrderedLayout$Slot[1]/VVerticalLayout[0]/domChild[3]</td>
- <td>22,7</td>
-</tr>
-<tr>
- <td>waitForElementNotPresent</td>
- <td>vaadin=runTreeTableItemDescriptionGeneratorTest::Root/VTooltip[0]</td>
- <td></td>
-</tr>
-<!--Cell and row tooltips-->
-<tr>
- <td>mouseClick</td>
- <td>vaadin=runTreeTableItemDescriptionGeneratorTest::/VVerticalLayout[0]/VOrderedLayout$Slot[1]/VVerticalLayout[0]/VOrderedLayout$Slot[0]/VCheckBox[0]/domChild[0]</td>
- <td>12,6</td>
-</tr>
-<!--Text tooltip-->
-<tr>
- <td>mouseMoveAt</td>
- <td>vaadin=runTreeTableItemDescriptionGeneratorTest::PID_Stable/domChild[1]/domChild[0]/domChild[1]/domChild[0]/domChild[1]/domChild[0]/domChild[0]</td>
- <td>22,7</td>
-</tr>
-<tr>
- <td>waitForElementPresent</td>
- <td>vaadin=runTreeTableItemDescriptionGeneratorTest::Root/VTooltip[0]</td>
- <td></td>
-</tr>
-<tr>
- <td>assertText</td>
- <td>vaadin=runTreeTableItemDescriptionGeneratorTest::Root/VTooltip[0]/FlowPanel[0]/domChild[1]</td>
- <td>Cell description item 1,Text</td>
-</tr>
-<tr>
- <td>mouseMoveAt</td>
- <td>vaadin=runTreeTableItemDescriptionGeneratorTest::/VVerticalLayout[0]/VOrderedLayout$Slot[1]/VVerticalLayout[0]/domChild[3]</td>
- <td>22,7</td>
-</tr>
-<tr>
- <td>waitForElementNotPresent</td>
- <td>vaadin=runTreeTableItemDescriptionGeneratorTest::Root/VTooltip[0]</td>
- <td></td>
-</tr>
-<!--Button tooltip-->
-<tr>
- <td>mouseMoveAt</td>
- <td>vaadin=runTreeTableItemDescriptionGeneratorTest::PID_Stable/FocusableScrollPanel[0]/VTreeTable$VTreeTableScrollBody[0]/VTreeTable$VTreeTableScrollBody$VTreeTableRow[1]/VButton[0]/domChild[0]/domChild[0]</td>
- <td>22,7</td>
-</tr>
-<tr>
- <td>waitForElementPresent</td>
- <td>vaadin=runTreeTableItemDescriptionGeneratorTest::Root/VTooltip[0]</td>
- <td></td>
-</tr>
-<tr>
- <td>assertText</td>
- <td>vaadin=runTreeTableItemDescriptionGeneratorTest::Root/VTooltip[0]/FlowPanel[0]/domChild[1]</td>
- <td>Cell description item 1,Component</td>
-</tr>
-<tr>
- <td>mouseMoveAt</td>
- <td>vaadin=runTreeTableItemDescriptionGeneratorTest::/VVerticalLayout[0]/VOrderedLayout$Slot[1]/VVerticalLayout[0]/domChild[3]</td>
- <td>22,7</td>
-</tr>
-<tr>
- <td>waitForElementNotPresent</td>
- <td>vaadin=runTreeTableItemDescriptionGeneratorTest::Root/VTooltip[0]</td>
- <td></td>
-</tr>
-<!--TextField tooltip-->
-<tr>
- <td>mouseMoveAt</td>
- <td>vaadin=runTreeTableItemDescriptionGeneratorTest::PID_Stable/FocusableScrollPanel[0]/VTreeTable$VTreeTableScrollBody[0]/VTreeTable$VTreeTableScrollBody$VTreeTableRow[1]/VTextField[0]</td>
- <td>22,7</td>
-</tr>
-<tr>
- <td>waitForElementPresent</td>
- <td>vaadin=runTreeTableItemDescriptionGeneratorTest::Root/VTooltip[0]</td>
- <td></td>
-</tr>
-<tr>
- <td>assertText</td>
- <td>vaadin=runTreeTableItemDescriptionGeneratorTest::Root/VTooltip[0]/FlowPanel[0]/domChild[1]</td>
- <td>Cell description item 1,Generated component</td>
-</tr>
-<tr>
- <td>mouseMoveAt</td>
- <td>vaadin=runTreeTableItemDescriptionGeneratorTest::/VVerticalLayout[0]/VOrderedLayout$Slot[1]/VVerticalLayout[0]/domChild[3]</td>
- <td>22,7</td>
-</tr>
-<tr>
- <td>waitForElementNotPresent</td>
- <td>vaadin=runTreeTableItemDescriptionGeneratorTest::Root/VTooltip[0]</td>
- <td></td>
-</tr>
-<!--Row and Component tooltips-->
-<tr>
- <td>mouseClick</td>
- <td>vaadin=runTreeTableItemDescriptionGeneratorTest::/VVerticalLayout[0]/VOrderedLayout$Slot[1]/VVerticalLayout[0]/VOrderedLayout$Slot[0]/VCheckBox[0]/domChild[0]</td>
- <td>7,8</td>
-</tr>
-<tr>
- <td>mouseClick</td>
- <td>vaadin=runTreeTableItemDescriptionGeneratorTest::/VVerticalLayout[0]/VOrderedLayout$Slot[1]/VVerticalLayout[0]/VOrderedLayout$Slot[1]/VCheckBox[0]/domChild[0]</td>
- <td>7,5</td>
-</tr>
-<!--Text tooltip-->
-<tr>
- <td>mouseMoveAt</td>
- <td>vaadin=runTreeTableItemDescriptionGeneratorTest::PID_Stable/domChild[1]/domChild[0]/domChild[1]/domChild[0]/domChild[1]/domChild[0]/domChild[0]</td>
- <td>22,7</td>
-</tr>
-<tr>
- <td>waitForElementPresent</td>
- <td>vaadin=runTreeTableItemDescriptionGeneratorTest::Root/VTooltip[0]</td>
- <td></td>
-</tr>
-<tr>
- <td>assertText</td>
- <td>vaadin=runTreeTableItemDescriptionGeneratorTest::Root/VTooltip[0]/FlowPanel[0]/domChild[1]</td>
- <td>Row description item 1</td>
-</tr>
-<tr>
- <td>mouseMoveAt</td>
- <td>vaadin=runTreeTableItemDescriptionGeneratorTest::/VVerticalLayout[0]/VOrderedLayout$Slot[1]/VVerticalLayout[0]/domChild[3]</td>
- <td>22,7</td>
-</tr>
-<tr>
- <td>waitForElementNotPresent</td>
- <td>vaadin=runTreeTableItemDescriptionGeneratorTest::Root/VTooltip[0]</td>
- <td></td>
-</tr>
-<!--Button tooltip-->
-<tr>
- <td>mouseMoveAt</td>
- <td>vaadin=runTreeTableItemDescriptionGeneratorTest::PID_Stable/FocusableScrollPanel[0]/VTreeTable$VTreeTableScrollBody[0]/VTreeTable$VTreeTableScrollBody$VTreeTableRow[1]/VButton[0]/domChild[0]/domChild[0]</td>
- <td>22,7</td>
-</tr>
-<tr>
- <td>waitForElementPresent</td>
- <td>vaadin=runTreeTableItemDescriptionGeneratorTest::Root/VTooltip[0]</td>
- <td></td>
-</tr>
-<tr>
- <td>assertText</td>
- <td>vaadin=runTreeTableItemDescriptionGeneratorTest::Root/VTooltip[0]/FlowPanel[0]/domChild[1]</td>
- <td>Button 1 description</td>
-</tr>
-<tr>
- <td>mouseMoveAt</td>
- <td>vaadin=runTreeTableItemDescriptionGeneratorTest::/VVerticalLayout[0]/VOrderedLayout$Slot[1]/VVerticalLayout[0]/domChild[3]</td>
- <td>22,7</td>
-</tr>
-<tr>
- <td>waitForElementNotPresent</td>
- <td>vaadin=runTreeTableItemDescriptionGeneratorTest::Root/VTooltip[0]</td>
- <td></td>
-</tr>
-<!--TextField tooltip-->
-<tr>
- <td>mouseMoveAt</td>
- <td>vaadin=runTreeTableItemDescriptionGeneratorTest::PID_Stable/FocusableScrollPanel[0]/VTreeTable$VTreeTableScrollBody[0]/VTreeTable$VTreeTableScrollBody$VTreeTableRow[1]/VTextField[0]</td>
- <td>22,7</td>
-</tr>
-<tr>
- <td>waitForElementPresent</td>
- <td>vaadin=runTreeTableItemDescriptionGeneratorTest::Root/VTooltip[0]</td>
- <td></td>
-</tr>
-<tr>
- <td>assertText</td>
- <td>vaadin=runTreeTableItemDescriptionGeneratorTest::Root/VTooltip[0]/FlowPanel[0]/domChild[1]</td>
- <td>Textfield's own description</td>
-</tr>
-<tr>
- <td>mouseMoveAt</td>
- <td>vaadin=runTreeTableItemDescriptionGeneratorTest::/VVerticalLayout[0]/VOrderedLayout$Slot[1]/VVerticalLayout[0]/domChild[3]</td>
- <td>22,7</td>
-</tr>
-<tr>
- <td>waitForElementNotPresent</td>
- <td>vaadin=runTreeTableItemDescriptionGeneratorTest::Root/VTooltip[0]</td>
- <td></td>
-</tr>
-<!--Row tooltips-->
-<tr>
- <td>mouseClick</td>
- <td>vaadin=runTreeTableItemDescriptionGeneratorTest::/VVerticalLayout[0]/VOrderedLayout$Slot[1]/VVerticalLayout[0]/VOrderedLayout$Slot[0]/VCheckBox[0]/domChild[0]</td>
- <td>7,8</td>
-</tr>
-<!--Text tooltip-->
-<tr>
- <td>mouseMoveAt</td>
- <td>vaadin=runTreeTableItemDescriptionGeneratorTest::PID_Stable/domChild[1]/domChild[0]/domChild[1]/domChild[0]/domChild[1]/domChild[0]/domChild[0]</td>
- <td>22,7</td>
-</tr>
-<tr>
- <td>waitForElementPresent</td>
- <td>vaadin=runTreeTableItemDescriptionGeneratorTest::Root/VTooltip[0]</td>
- <td></td>
-</tr>
-<tr>
- <td>assertText</td>
- <td>vaadin=runTreeTableItemDescriptionGeneratorTest::Root/VTooltip[0]/FlowPanel[0]/domChild[1]</td>
- <td>Row description item 1</td>
-</tr>
-<tr>
- <td>mouseMoveAt</td>
- <td>vaadin=runTreeTableItemDescriptionGeneratorTest::/VVerticalLayout[0]/VOrderedLayout$Slot[1]/VVerticalLayout[0]/domChild[3]</td>
- <td>22,7</td>
-</tr>
-<tr>
- <td>waitForElementNotPresent</td>
- <td>vaadin=runTreeTableItemDescriptionGeneratorTest::Root/VTooltip[0]</td>
- <td></td>
-</tr>
-<!--Button tooltip-->
-<tr>
- <td>mouseMoveAt</td>
- <td>vaadin=runTreeTableItemDescriptionGeneratorTest::PID_Stable/FocusableScrollPanel[0]/VTreeTable$VTreeTableScrollBody[0]/VTreeTable$VTreeTableScrollBody$VTreeTableRow[1]/VButton[0]/domChild[0]/domChild[0]</td>
- <td>22,7</td>
-</tr>
-<tr>
- <td>waitForElementPresent</td>
- <td>vaadin=runTreeTableItemDescriptionGeneratorTest::Root/VTooltip[0]</td>
- <td></td>
-</tr>
-<tr>
- <td>assertText</td>
- <td>vaadin=runTreeTableItemDescriptionGeneratorTest::Root/VTooltip[0]/FlowPanel[0]/domChild[1]</td>
- <td>Row description item 1</td>
-</tr>
-<tr>
- <td>mouseMoveAt</td>
- <td>vaadin=runTreeTableItemDescriptionGeneratorTest::/VVerticalLayout[0]/VOrderedLayout$Slot[1]/VVerticalLayout[0]/domChild[3]</td>
- <td>22,7</td>
-</tr>
-<tr>
- <td>waitForElementNotPresent</td>
- <td>vaadin=runTreeTableItemDescriptionGeneratorTest::Root/VTooltip[0]</td>
- <td></td>
-</tr>
-<!--TextField tooltip-->
-<tr>
- <td>mouseMoveAt</td>
- <td>vaadin=runTreeTableItemDescriptionGeneratorTest::PID_Stable/FocusableScrollPanel[0]/VTreeTable$VTreeTableScrollBody[0]/VTreeTable$VTreeTableScrollBody$VTreeTableRow[1]/VTextField[0]</td>
- <td>22,7</td>
-</tr>
-<tr>
- <td>waitForElementPresent</td>
- <td>vaadin=runTreeTableItemDescriptionGeneratorTest::Root/VTooltip[0]</td>
- <td></td>
-</tr>
-<tr>
- <td>assertText</td>
- <td>vaadin=runTreeTableItemDescriptionGeneratorTest::Root/VTooltip[0]/FlowPanel[0]/domChild[1]</td>
- <td>Row description item 1</td>
-</tr>
-<tr>
- <td>mouseMoveAt</td>
- <td>vaadin=runTreeTableItemDescriptionGeneratorTest::/VVerticalLayout[0]/VOrderedLayout$Slot[1]/VVerticalLayout[0]/domChild[3]</td>
- <td>22,7</td>
-</tr>
-<tr>
- <td>waitForElementNotPresent</td>
- <td>vaadin=runTreeTableItemDescriptionGeneratorTest::Root/VTooltip[0]</td>
- <td></td>
-</tr>
-</tbody></table>
-</body>
-</html>
+++ /dev/null
-/*
- * Copyright 2012 Vaadin Ltd.
- *
- * Licensed under the Apache License, Version 2.0 (the "License"); you may not
- * use this file except in compliance with the License. You may obtain a copy of
- * the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
- * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
- * License for the specific language governing permissions and limitations under
- * the License.
- */
-package com.vaadin.tests.components.treetable;
-
-import com.vaadin.tests.components.table.TableItemDescriptionGeneratorTest;
-import com.vaadin.ui.Table;
-import com.vaadin.ui.TreeTable;
-
-public class TreeTableItemDescriptionGeneratorTest extends
- TableItemDescriptionGeneratorTest {
- @Override
- protected Table createTable() {
- return new TreeTable();
- }
-}
--- /dev/null
+/*
+ * Copyright 2012 Vaadin Ltd.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License"); you may not
+ * use this file except in compliance with the License. You may obtain a copy of
+ * the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
+ * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
+ * License for the specific language governing permissions and limitations under
+ * the License.
+ */
+package com.vaadin.tests.components.treetable;
+
+import com.vaadin.tests.components.table.TableItemDescriptionGeneratorUI;
+import com.vaadin.ui.Table;
+import com.vaadin.ui.TreeTable;
+
+public class TreeTableItemDescriptionGeneratorUI extends
+ TableItemDescriptionGeneratorUI {
+
+ @Override
+ protected Table createTable() {
+ return new TreeTable();
+ }
+
+}
--- /dev/null
+/*
+ * Copyright 2000-2014 Vaadin Ltd.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License"); you may not
+ * use this file except in compliance with the License. You may obtain a copy of
+ * the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
+ * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
+ * License for the specific language governing permissions and limitations under
+ * the License.
+ */
+package com.vaadin.tests.components.treetable;
+
+import static org.junit.Assert.assertEquals;
+
+import java.util.List;
+
+import org.junit.Test;
+
+import com.vaadin.testbench.By;
+import com.vaadin.testbench.TestBenchElement;
+import com.vaadin.testbench.elements.CheckBoxElement;
+import com.vaadin.testbench.elements.TreeTableElement;
+import com.vaadin.tests.tb3.TooltipTest;
+
+/**
+ * Tests TreeTable tooltips with various settings.
+ *
+ * @author Vaadin Ltd
+ */
+public class TreeTableItemDescriptionGeneratorUITest extends TooltipTest {
+
+ @Test
+ public void testDescriptions() throws Exception {
+ openTestURL();
+
+ checkTooltipNotPresent();
+
+ TreeTableElement treeTable = $(TreeTableElement.class).first();
+ List<CheckBoxElement> checkboxes = $(CheckBoxElement.class).all();
+ assertEquals(3, checkboxes.size());
+
+ // check text description
+ TestBenchElement cell_1_0 = treeTable.getCell(1, 0);
+ checkTooltip(cell_1_0, "Cell description item 1, Text");
+
+ // move somewhere without a description
+ checkTooltip(checkboxes.get(2), null);
+
+ // check button description
+ TestBenchElement cell_1_1 = treeTable.getCell(1, 1);
+ checkTooltip(cell_1_1, "Button 1 description");
+
+ // move somewhere without a description
+ checkTooltip(checkboxes.get(2), null);
+
+ // check textfield's description
+ TestBenchElement cell_1_2 = treeTable.getCell(1, 2);
+ checkTooltip(cell_1_2, "Textfield's own description");
+
+ // move somewhere without a description
+ checkTooltip(checkboxes.get(2), null);
+
+ // uncheck component tooltips
+ checkboxes.get(0).findElement(By.tagName("input")).click();
+
+ // check text description
+ cell_1_0 = treeTable.getCell(1, 0);
+ checkTooltip(cell_1_0, "Cell description item 1, Text");
+
+ // move somewhere without a description
+ checkTooltip(checkboxes.get(2), null);
+
+ // check button description
+ cell_1_1 = treeTable.getCell(1, 1);
+ checkTooltip(cell_1_1, "Cell description item 1, Component");
+
+ // move somewhere without a description
+ checkTooltip(checkboxes.get(2), null);
+
+ // check textfield's description
+ cell_1_2 = treeTable.getCell(1, 2);
+ checkTooltip(cell_1_2, "Cell description item 1, Generated component");
+
+ // move somewhere without a description
+ checkTooltip(checkboxes.get(2), null);
+
+ // check component tooltips
+ checkboxes.get(0).findElement(By.tagName("input")).click();
+ // uncheck cell tooltips
+ checkboxes.get(1).findElement(By.tagName("input")).click();
+
+ // check text description
+ cell_1_0 = treeTable.getCell(1, 0);
+ checkTooltip(cell_1_0, "Row description item 1");
+
+ // move somewhere without a description
+ checkTooltip(checkboxes.get(2), null);
+
+ // check button description
+ cell_1_1 = treeTable.getCell(1, 1);
+ checkTooltip(cell_1_1, "Button 1 description");
+
+ // move somewhere without a description
+ checkTooltip(checkboxes.get(2), null);
+
+ // check textfield's description
+ cell_1_2 = treeTable.getCell(1, 2);
+ checkTooltip(cell_1_2, "Textfield's own description");
+
+ // move somewhere without a description
+ checkTooltip(checkboxes.get(2), null);
+
+ // uncheck component tooltips
+ checkboxes.get(0).findElement(By.tagName("input")).click();
+
+ // check text description
+ cell_1_0 = treeTable.getCell(1, 0);
+ checkTooltip(cell_1_0, "Row description item 1");
+
+ // move somewhere without a description
+ checkTooltip(checkboxes.get(2), null);
+
+ // check button description
+ cell_1_1 = treeTable.getCell(1, 1);
+ checkTooltip(cell_1_1, "Row description item 1");
+
+ // move somewhere without a description
+ checkTooltip(checkboxes.get(2), null);
+
+ // check textfield's description
+ cell_1_2 = treeTable.getCell(1, 2);
+ checkTooltip(cell_1_2, "Row description item 1");
+
+ // move somewhere without a description
+ checkTooltip(checkboxes.get(2), null);
+ }
+
+}