From 393a5faf1e0e21212ee0f9fed756244d7c3dc807 Mon Sep 17 00:00:00 2001 From: Artur Signell Date: Wed, 28 Nov 2012 20:53:55 +0200 Subject: Fixed tooltip handling for TreeTable (#9088) Change-Id: I9e4ae2ae4a040de795121db359d930ccda115f62 --- client/src/com/vaadin/client/ui/VTreeTable.java | 4 ++-- .../client/ui/treetable/TreeTableConnector.java | 27 ++++++++++++++++++++++ 2 files changed, 29 insertions(+), 2 deletions(-) (limited to 'client/src/com') diff --git a/client/src/com/vaadin/client/ui/VTreeTable.java b/client/src/com/vaadin/client/ui/VTreeTable.java index d4bfa9698d..318fcb3bca 100644 --- a/client/src/com/vaadin/client/ui/VTreeTable.java +++ b/client/src/com/vaadin/client/ui/VTreeTable.java @@ -122,7 +122,7 @@ public class VTreeTable extends VScrollTable { } } - class VTreeTableScrollBody extends VScrollTable.VScrollTableBody { + public class VTreeTableScrollBody extends VScrollTable.VScrollTableBody { private int indentWidth = -1; VTreeTableScrollBody() { @@ -138,7 +138,7 @@ public class VTreeTable extends VScrollTable { return new VTreeTableRow(uidl, aligns2); } - class VTreeTableRow extends + public class VTreeTableRow extends VScrollTable.VScrollTableBody.VScrollTableRow { private boolean isTreeCellAdded = false; diff --git a/client/src/com/vaadin/client/ui/treetable/TreeTableConnector.java b/client/src/com/vaadin/client/ui/treetable/TreeTableConnector.java index be6e54c5ce..db16bb32a1 100644 --- a/client/src/com/vaadin/client/ui/treetable/TreeTableConnector.java +++ b/client/src/com/vaadin/client/ui/treetable/TreeTableConnector.java @@ -15,12 +15,16 @@ */ package com.vaadin.client.ui.treetable; +import com.google.gwt.dom.client.Element; import com.vaadin.client.ApplicationConnection; +import com.vaadin.client.TooltipInfo; import com.vaadin.client.UIDL; +import com.vaadin.client.Util; import com.vaadin.client.ui.FocusableScrollPanel; import com.vaadin.client.ui.VScrollTable.VScrollTableBody.VScrollTableRow; import com.vaadin.client.ui.VTreeTable; import com.vaadin.client.ui.VTreeTable.PendingNavigationEvent; +import com.vaadin.client.ui.VTreeTable.VTreeTableScrollBody.VTreeTableRow; import com.vaadin.client.ui.table.TableConnector; import com.vaadin.shared.ui.Connect; import com.vaadin.shared.ui.treetable.TreeTableConstants; @@ -112,4 +116,27 @@ public class TreeTableConnector extends TableConnector { public TreeTableState getState() { return (TreeTableState) super.getState(); } + + @Override + public TooltipInfo getTooltipInfo(Element element) { + + TooltipInfo info = null; + + if (element != getWidget().getElement()) { + Object node = Util.findWidget( + (com.google.gwt.user.client.Element) element, + VTreeTableRow.class); + + if (node != null) { + VTreeTableRow row = (VTreeTableRow) node; + info = row.getTooltip(element); + } + } + + if (info == null) { + info = super.getTooltipInfo(element); + } + + return info; + } } -- cgit v1.2.3