From a74876dc07c651fd3e82f1dc60c0b6b4587a9baa Mon Sep 17 00:00:00 2001 From: Matti Tahvonen Date: Tue, 9 Mar 2010 16:02:39 +0000 Subject: [PATCH] enhanced docs svn changeset:11719/svn branch:6.3 --- src/com/vaadin/terminal/gwt/client/Util.java | 15 ++++++++++++--- 1 file changed, 12 insertions(+), 3 deletions(-) diff --git a/src/com/vaadin/terminal/gwt/client/Util.java b/src/com/vaadin/terminal/gwt/client/Util.java index 5738e1ba49..5e57ad9128 100644 --- a/src/com/vaadin/terminal/gwt/client/Util.java +++ b/src/com/vaadin/terminal/gwt/client/Util.java @@ -43,7 +43,8 @@ public class Util { * * Returns the topmost element of from given coordinates. * - * TODO fix crossplat issues clientX vs pageX. See quircksmode + * TODO fix crossplat issues clientX vs pageX. See quircksmode. Not critical + * for vaadin as we scroll div istead of page. * * @param x * @param y @@ -849,13 +850,17 @@ public class Util { /** * Helper method to find first instance of given Widget type found by - * traversing DOM upwards. + * traversing DOM upwards from given element. * * @param element + * the element where to start seeking of Widget * @param class1 + * the Widget type to seek for */ - public static T findWidget(Element element, Class class1) { + public static T findWidget(Element element, + Class class1) { if (element != null) { + /* First seek for the first EventListener (~Widget) from dom */ EventListener eventListener = null; while (eventListener == null && element != null) { eventListener = Event.getEventListener(element); @@ -864,6 +869,10 @@ public class Util { } } if (eventListener != null) { + /* + * Then find the first widget of type class1 from widget + * hierarchy + */ Widget w = (Widget) eventListener; while (w != null) { if (class1 == null || w.getClass() == class1) { -- 2.39.5