summaryrefslogtreecommitdiffstats
path: root/client
diff options
context:
space:
mode:
authordenisanisimov <denis@vaadin.com>2013-08-02 14:32:47 +0300
committerVaadin Code Review <review@vaadin.com>2013-08-02 11:40:10 +0000
commit99c7d0b3cde116bf31b00bd31f62f9f4920b1762 (patch)
tree8d4ccceb0225cd2d4a3b564173d4e7dadab72850 /client
parentd97cfbc9a1409582bbe4456f08f648921b7e3300 (diff)
downloadvaadin-framework-99c7d0b3cde116bf31b00bd31f62f9f4920b1762.tar.gz
vaadin-framework-99c7d0b3cde116bf31b00bd31f62f9f4920b1762.zip
Show tooltips for ordered layout captions (#10046)
Change-Id: I80cb1cbd573d7e0de8aa200a4513dc32984ba9f5
Diffstat (limited to 'client')
-rw-r--r--client/src/com/vaadin/client/ui/orderedlayout/AbstractOrderedLayoutConnector.java39
1 files changed, 39 insertions, 0 deletions
diff --git a/client/src/com/vaadin/client/ui/orderedlayout/AbstractOrderedLayoutConnector.java b/client/src/com/vaadin/client/ui/orderedlayout/AbstractOrderedLayoutConnector.java
index cb6ad25e97..cea993310f 100644
--- a/client/src/com/vaadin/client/ui/orderedlayout/AbstractOrderedLayoutConnector.java
+++ b/client/src/com/vaadin/client/ui/orderedlayout/AbstractOrderedLayoutConnector.java
@@ -25,6 +25,7 @@ import com.vaadin.client.ConnectorHierarchyChangeEvent;
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;
@@ -349,6 +350,44 @@ public abstract class AbstractOrderedLayoutConnector extends
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.