import com.vaadin.client.LayoutManager;
import com.vaadin.client.Profiler;
import com.vaadin.client.ServerConnector;
+import com.vaadin.client.TooltipInfo;
import com.vaadin.client.Util;
import com.vaadin.client.communication.StateChangeEvent;
import com.vaadin.client.communication.StateChangeEvent.StateChangeHandler;
updateInternalState();
}
+ /*
+ * (non-Javadoc)
+ *
+ * @see
+ * com.vaadin.client.ui.AbstractComponentConnector#getTooltipInfo(com.google
+ * .gwt.dom.client.Element)
+ */
+ @Override
+ public TooltipInfo getTooltipInfo(com.google.gwt.dom.client.Element element) {
+ if (element != getWidget().getElement()) {
+ Slot slot = Util.findWidget(
+ (com.google.gwt.user.client.Element) element, Slot.class);
+ if (slot != null && slot.getCaptionElement() != null
+ && slot.getCaptionElement().isOrHasChild(element)) {
+ ComponentConnector connector = Util.findConnectorFor(slot
+ .getWidget());
+ if (connector != null) {
+ return connector.getTooltipInfo(element);
+ }
+ }
+ }
+ return super.getTooltipInfo(element);
+ }
+
+ /*
+ * (non-Javadoc)
+ *
+ * @see com.vaadin.client.ui.AbstractComponentConnector#hasTooltip()
+ */
+ @Override
+ public boolean hasTooltip() {
+ /*
+ * Tooltips are fetched from child connectors -> there's no quick way of
+ * checking whether there might a tooltip hiding somewhere
+ */
+ return true;
+ }
+
/**
* Updates DOM properties and listeners based on the current state of this
* layout and its children.
--- /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>Required error tootlip</title>
+</head>
+<body>
+<table cellpadding="1" cellspacing="1" border="1">
+<thead>
+<tr><td rowspan="1" colspan="3">Required error tooltip</td></tr>
+</thead><tbody>
+<tr>
+ <td>open</td>
+ <td>/run/com.vaadin.tests.components.orderedlayout.ErrorIndicator?restartApplication</td>
+ <td></td>
+</tr>
+<tr>
+ <td>showTooltip</td>
+ <td>//div[@id='gwt-uid-4']/span</td>
+ <td>43,4</td>
+</tr>
+
+<tr>
+ <td>screenCapture</td>
+ <td></td>
+ <td>tooltipVertivcalCaption</td>
+</tr>
+<tr>
+ <td>waitForVaadin</td>
+ <td></td>
+ <td></td>
+</tr>
+<tr>
+ <td>showTooltip</td>
+ <td>//div[@id='gwt-uid-4']/span[2]</td>
+ <td>3,6</td>
+</tr>
+<tr>
+ <td>screenCapture</td>
+ <td></td>
+ <td>tooltipVertivcalRequiredIndicator</td>
+</tr>
+<tr>
+ <td>waitForVaadin</td>
+ <td></td>
+ <td></td>
+</tr>
+<tr>
+ <td>showTooltip</td>
+ <td>//div[@id='gwt-uid-6']/span</td>
+ <td>38,11</td>
+</tr>
+<tr>
+ <td>screenCapture</td>
+ <td></td>
+ <td>tooltipHorizontalCaption</td>
+</tr>
+<tr>
+ <td>waitForVaadin</td>
+ <td></td>
+ <td></td>
+</tr>
+<tr>
+ <td>showTooltip</td>
+ <td>//div[@id='gwt-uid-6']/span[2]</td>
+ <td>3,4</td>
+</tr>
+<tr>
+ <td>screenCapture</td>
+ <td></td>
+ <td>tooltipHorizontalRequiredIndicator</td>
+</tr>
+<tr>
+ <td>waitForVaadin</td>
+ <td></td>
+ <td></td>
+</tr>
+</tbody></table>
+</body>
+</html>
--- /dev/null
+/*
+ * Copyright 2000-2013 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.orderedlayout;
+
+import com.vaadin.server.VaadinRequest;
+import com.vaadin.tests.components.AbstractTestUI;
+import com.vaadin.ui.HorizontalLayout;
+import com.vaadin.ui.TextField;
+import com.vaadin.ui.VerticalLayout;
+
+public class ErrorIndicator extends AbstractTestUI {
+
+ /*
+ * (non-Javadoc)
+ *
+ * @see com.vaadin.tests.components.AbstractTestUI#setup(com.vaadin.server.
+ * VaadinRequest)
+ */
+ @Override
+ protected void setup(VaadinRequest request) {
+ VerticalLayout layout = new VerticalLayout();
+
+ TextField inVertical = new TextField();
+ inVertical.setRequired(true);
+ inVertical.setRequiredError("Vertical layout tooltip");
+ inVertical.setCaption("Vertical layout caption");
+
+ layout.addComponent(inVertical);
+ addComponent(layout);
+
+ HorizontalLayout horizontalLayout = new HorizontalLayout();
+
+ TextField inHorizontal = new TextField();
+ inHorizontal.setRequired(true);
+ inHorizontal.setRequiredError("Horizontal layout tooltip");
+ inHorizontal.setCaption("Horizontal layout caption");
+
+ horizontalLayout.addComponent(inHorizontal);
+ layout.addComponent(horizontalLayout);
+ }
+
+ /*
+ * (non-Javadoc)
+ *
+ * @see com.vaadin.tests.components.AbstractTestUI#getTestDescription()
+ */
+ @Override
+ protected String getTestDescription() {
+ return "Show tooltip for caption and required indicator";
+ }
+
+ /*
+ * (non-Javadoc)
+ *
+ * @see com.vaadin.tests.components.AbstractTestUI#getTicketNumber()
+ */
+ @Override
+ protected Integer getTicketNumber() {
+ return 10046;
+ }
+
+}