diff options
author | Manuel Carrasco Moñino <manuel.carrasco.m@gmail.com> | 2014-02-08 15:02:04 +0100 |
---|---|---|
committer | Manuel Carrasco Moñino <manuel.carrasco.m@gmail.com> | 2014-02-08 15:02:04 +0100 |
commit | 6550c9886e69d0640d40580edcbe96b7f457c5c8 (patch) | |
tree | bd69148cb2eb095fb07d350a16407da0f2cfe750 /gwtquery-core | |
parent | df049d13c90fa98bab298385e0653dc3e86c4847 (diff) | |
download | gwtquery-6550c9886e69d0640d40580edcbe96b7f457c5c8.tar.gz gwtquery-6550c9886e69d0640d40580edcbe96b7f457c5c8.zip |
Updating lazy interfaces
Diffstat (limited to 'gwtquery-core')
-rw-r--r-- | gwtquery-core/src/main/java/com/google/gwt/query/client/LazyGQuery.java | 26 | ||||
-rw-r--r-- | gwtquery-core/src/main/java/com/google/gwt/query/client/plugins/LazyEvents.java | 9 |
2 files changed, 20 insertions, 15 deletions
diff --git a/gwtquery-core/src/main/java/com/google/gwt/query/client/LazyGQuery.java b/gwtquery-core/src/main/java/com/google/gwt/query/client/LazyGQuery.java index 804e533b..992598e5 100644 --- a/gwtquery-core/src/main/java/com/google/gwt/query/client/LazyGQuery.java +++ b/gwtquery-core/src/main/java/com/google/gwt/query/client/LazyGQuery.java @@ -12,24 +12,20 @@ * the License. */ package com.google.gwt.query.client; +import static com.google.gwt.query.client.plugins.QueuePlugin.*; +import java.util.ArrayList; +import java.util.Arrays; +import java.util.List; +import java.util.Map; import com.google.gwt.core.client.GWT; import com.google.gwt.core.client.JavaScriptObject; import com.google.gwt.core.client.JsArray; import com.google.gwt.core.client.JsArrayMixed; import com.google.gwt.core.client.JsArrayString; import com.google.gwt.core.client.ScriptInjector; -import com.google.gwt.dom.client.BodyElement; -import com.google.gwt.dom.client.ButtonElement; -import com.google.gwt.dom.client.Document; -import com.google.gwt.dom.client.Element; -import com.google.gwt.dom.client.InputElement; -import com.google.gwt.dom.client.Node; -import com.google.gwt.dom.client.NodeList; -import com.google.gwt.dom.client.OptionElement; -import com.google.gwt.dom.client.SelectElement; +import com.google.gwt.dom.client.*; import com.google.gwt.dom.client.Style.Display; import com.google.gwt.dom.client.Style.HasCssName; -import com.google.gwt.dom.client.TextAreaElement; import com.google.gwt.query.client.css.CSS; import com.google.gwt.query.client.css.HasCssValue; import com.google.gwt.query.client.css.TakesCssValue; @@ -60,11 +56,6 @@ import com.google.gwt.user.client.EventListener; import com.google.gwt.user.client.Window; import com.google.gwt.user.client.ui.IsWidget; import com.google.gwt.user.client.ui.Widget; -import java.util.ArrayList; -import java.util.Arrays; -import java.util.List; -import java.util.Map; -import static com.google.gwt.query.client.plugins.QueuePlugin.Queue; import com.google.gwt.query.client.GQuery.*; import com.google.gwt.query.client.LazyBase; @@ -2285,6 +2276,11 @@ public interface LazyGQuery<T> extends LazyBase<T>{ String toString(boolean pretty); /** + * Trigger a browser native event on each matched element. + */ + LazyGQuery<T> trigger(NativeEvent event); + + /** * Trigger a set of events on each matched element. * * For keyboard events you can pass a second parameter which represents the key-code of the pushed diff --git a/gwtquery-core/src/main/java/com/google/gwt/query/client/plugins/LazyEvents.java b/gwtquery-core/src/main/java/com/google/gwt/query/client/plugins/LazyEvents.java index 37244237..dec30be8 100644 --- a/gwtquery-core/src/main/java/com/google/gwt/query/client/plugins/LazyEvents.java +++ b/gwtquery-core/src/main/java/com/google/gwt/query/client/plugins/LazyEvents.java @@ -16,6 +16,7 @@ import com.google.gwt.dom.client.Element; import com.google.gwt.dom.client.FormElement; import com.google.gwt.dom.client.NativeEvent; import com.google.gwt.dom.client.Node; +import com.google.gwt.event.dom.client.HasNativeEvent; import com.google.gwt.query.client.Function; import com.google.gwt.query.client.GQuery; import com.google.gwt.query.client.js.JsUtils; @@ -132,6 +133,14 @@ public interface LazyEvents<T> extends LazyBase<T>{ LazyEvents<T> trigger(int eventbits, int... keys); /** + * Trigger a native event in all matched elements. + * + * @param nativeEvent the browser native event. + * @functions a set of function to run if the event is not canceled. + */ + LazyEvents<T> trigger(NativeEvent nativeEvent, Function... functions); + + /** * Trigger a html event in all matched elements. * * @param htmlEvent A string representing the desired html event. |