Revision: 8916
Author: [email protected]
Date: Fri Oct 1 09:39:58 2010
Log: Fix nonstandard two method handler interface that probably would have
broken UiBinder.
Review at http://gwt-code-reviews.appspot.com/941801
Review by: [email protected]
http://code.google.com/p/google-web-toolkit/source/detail?r=8916
Modified:
/trunk/user/src/com/google/gwt/event/logical/shared/AttachEvent.java
/trunk/user/test/com/google/gwt/user/client/ui/WidgetOnLoadTest.java
=======================================
--- /trunk/user/src/com/google/gwt/event/logical/shared/AttachEvent.java
Mon Sep 13 16:10:55 2010
+++ /trunk/user/src/com/google/gwt/event/logical/shared/AttachEvent.java
Fri Oct 1 09:39:58 2010
@@ -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);
}
}
=======================================
--- /trunk/user/test/com/google/gwt/user/client/ui/WidgetOnLoadTest.java
Mon Sep 13 16:10:55 2010
+++ /trunk/user/test/com/google/gwt/user/client/ui/WidgetOnLoadTest.java
Fri Oct 1 09:39:58 2010
@@ -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