From: Manolo Carrasco Date: Tue, 16 Dec 2014 06:51:31 +0000 (+0100) Subject: Make special events api more easy for plugins X-Git-Tag: gwtquery-project-1.4.3~4^2~14 X-Git-Url: https://source.dussan.org/?a=commitdiff_plain;h=8d14bba23b22cc88312dcefd6e2a8e9cabfb37b2;p=gwtquery.git Make special events api more easy for plugins --- 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 newList = JsObjectArray.createArray().cast(); for (int i = 0; i < elementEvents.length(); i++) { BindFunction listener = elementEvents.get(i);