diff options
author | Manolo Carrasco <manolo@apache.org> | 2014-12-16 07:51:31 +0100 |
---|---|---|
committer | Manolo Carrasco <manolo@apache.org> | 2014-12-21 08:35:03 +0100 |
commit | 8d14bba23b22cc88312dcefd6e2a8e9cabfb37b2 (patch) | |
tree | 41c175b8c0e7ec5ee5ac64f936f8f05be9c10487 | |
parent | 8da271599c341f385ae4240f3dd37649aa81b082 (diff) | |
download | gwtquery-8d14bba23b22cc88312dcefd6e2a8e9cabfb37b2.tar.gz gwtquery-8d14bba23b22cc88312dcefd6e2a8e9cabfb37b2.zip |
Make special events api more easy for plugins
-rw-r--r-- | gwtquery-core/src/main/java/com/google/gwt/query/client/plugins/events/EventsListener.java | 15 |
1 files changed, 8 insertions, 7 deletions
diff --git a/gwtquery-core/src/main/java/com/google/gwt/query/client/plugins/events/EventsListener.java b/gwtquery-core/src/main/java/com/google/gwt/query/client/plugins/events/EventsListener.java index 5f3cf531..aef9d876 100644 --- a/gwtquery-core/src/main/java/com/google/gwt/query/client/plugins/events/EventsListener.java +++ b/gwtquery-core/src/main/java/com/google/gwt/query/client/plugins/events/EventsListener.java @@ -74,19 +74,20 @@ public class EventsListener implements EventListener { return originalType; } - public Function createDelegateHandler(Function originalHandler) { - return new SpecialMouseEventHandler(originalHandler); + public HandlerWrapperFunction createDelegateHandler(Function originalHandler) { + return new HandlerWrapperFunction(originalHandler); } } - private interface HandlerWrapper { + public interface HandlerWrapper { Function getOriginalHandler(); } - private static class SpecialMouseEventHandler extends Function implements HandlerWrapper { + + public static class HandlerWrapperFunction extends Function implements HandlerWrapper { private Function delegateHandler; - public SpecialMouseEventHandler(Function originalHandler) { + public HandlerWrapperFunction(Function originalHandler) { this.delegateHandler = originalHandler; } @@ -401,7 +402,7 @@ public class EventsListener implements EventListener { /** * We have to set the gQuery event listener to the element again when - * the element is a widget, because when GWT detaches a widget it removes the + * the element is a widget, because when GWT detaches a widget it removes the * event listener. */ public static void rebind(Element e) { @@ -732,7 +733,7 @@ public class EventsListener implements EventListener { public void unbind(int eventbits, String namespace, String eventName, String originalEventType, Function f) { - + JsObjectArray<BindFunction> newList = JsObjectArray.createArray().cast(); for (int i = 0; i < elementEvents.length(); i++) { BindFunction listener = elementEvents.get(i); |