Fixes issue 3263 by added protected delegateEvent method to widget.
Pair programed with jlabanca
git-svn-id: https://google-web-toolkit.googlecode.com/svn/releases/1.6@4409 8db76d5a-ed1c-0410-87a9-c151d255dfc7
diff --git a/user/src/com/google/gwt/user/client/ui/Widget.java b/user/src/com/google/gwt/user/client/ui/Widget.java
index b994201..e544e6a 100644
--- a/user/src/com/google/gwt/user/client/ui/Widget.java
+++ b/user/src/com/google/gwt/user/client/ui/Widget.java
@@ -41,7 +41,6 @@
*/
int eventsToSink;
private boolean attached;
-
private Object layoutData;
private Widget parent;
private HandlerManager handlerManager;
@@ -130,7 +129,7 @@
* Overridden to defer the call to super.sinkEvents until the first time this
* widget is attached to the dom, as a performance enhancement. Subclasses
* wishing to customize sinkEvents can preserve this deferred sink behavior by
- * putting their implementation behind a check of {@link #isOrWasAttached()}:
+ * putting their implementation behind a check of <code>isOrWasAttached()</code>:
*
* <pre>
* {@literal @}Override
@@ -183,6 +182,17 @@
}
/**
+ * Fires an event on a child widget. Used to delegate the handling of an event
+ * from one widget to another.
+ *
+ * @param event the event
+ * @param target fire the event on the given target
+ */
+ protected void delegateEvent(Widget target, GwtEvent<?> event) {
+ target.fireEvent(event);
+ }
+
+ /**
* If a widget contains one or more child widgets that are not in the logical
* widget hierarchy (the child is physically connected only on the DOM level),
* it must override this method and call {@link #onAttach()} for each of its