Reviewers: rice,

Description:
Fix nonstandard two method handler interface that probably would have
broken UiBinder.


Please review this at http://gwt-code-reviews.appspot.com/941801/show

Affected files:
  M user/src/com/google/gwt/event/logical/shared/AttachEvent.java
  M user/test/com/google/gwt/user/client/ui/WidgetOnLoadTest.java


Index: user/src/com/google/gwt/event/logical/shared/AttachEvent.java
===================================================================
--- user/src/com/google/gwt/event/logical/shared/AttachEvent.java (revision 8909) +++ user/src/com/google/gwt/event/logical/shared/AttachEvent.java (working copy)
@@ -29,8 +29,7 @@
    * Implemented by objects that handle {...@link AttachEvent}.
    */
   public interface Handler extends EventHandler {
-    void onAttach(AttachEvent event);
-    void onDetach(AttachEvent event);
+    void onAttachOrDetach(AttachEvent event);
   }

   /**
@@ -98,10 +97,6 @@

   @Override
   protected void dispatch(AttachEvent.Handler handler) {
-    if (attached) {
-      handler.onAttach(this);
-    } else {
-      handler.onDetach(this);
-    }
+    handler.onAttachOrDetach(this);
   }
 }
Index: user/test/com/google/gwt/user/client/ui/WidgetOnLoadTest.java
===================================================================
--- user/test/com/google/gwt/user/client/ui/WidgetOnLoadTest.java (revision 8909) +++ user/test/com/google/gwt/user/client/ui/WidgetOnLoadTest.java (working copy)
@@ -111,11 +111,12 @@
       int delegateAttachOrder;
       int delegateDetachOrder;

-      public void onAttach(AttachEvent event) {
-        delegateAttachOrder = ++orderIndex;
-      }
-      public void onDetach(AttachEvent event) {
-        delegateDetachOrder = ++orderIndex;
+      public void onAttachOrDetach(AttachEvent event) {
+        if (event.isAttached()) {
+          delegateAttachOrder = ++orderIndex;
+        } else {
+          delegateDetachOrder = ++orderIndex;
+        }
       }
     }



--
http://groups.google.com/group/Google-Web-Toolkit-Contributors

Reply via email to