From 0c1e6a3967c1667122c266c10822c6ee6925674d Mon Sep 17 00:00:00 2001
From: Manolo Carrasco
Date: Mon, 27 Jan 2014 16:30:40 +0100
Subject: Update lazy interfaces
---
gwtquery-core/pom.xml | 8 --
.../com/google/gwt/query/client/LazyGQuery.java | 105 ++++++++++++++++++++-
.../gwt/query/client/plugins/LazyEffects.java | 1 +
.../gwt/query/client/plugins/LazyEvents.java | 3 +
.../gwt/query/client/plugins/LazyWidgets.java | 1 +
5 files changed, 106 insertions(+), 12 deletions(-)
(limited to 'gwtquery-core')
diff --git a/gwtquery-core/pom.xml b/gwtquery-core/pom.xml
index 6ccb811b..1514e2e5 100644
--- a/gwtquery-core/pom.xml
+++ b/gwtquery-core/pom.xml
@@ -18,14 +18,6 @@
4.7
test
-
com.google.gwt
gwt-user
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 da25dba4..958ed2a8 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,23 +12,61 @@
* the License.
*/
package com.google.gwt.query.client;
-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.Style.Display;
import com.google.gwt.dom.client.Style.HasCssName;
-import com.google.gwt.query.client.GQuery.Offset;
+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;
import com.google.gwt.query.client.css.TakesCssValue.CssSetter;
+import com.google.gwt.query.client.impl.AttributeImpl;
+import com.google.gwt.query.client.impl.DocumentStyleImpl;
+import com.google.gwt.query.client.impl.SelectorEngine;
+import com.google.gwt.query.client.js.JsCache;
+import com.google.gwt.query.client.js.JsMap;
import com.google.gwt.query.client.js.JsNamedArray;
import com.google.gwt.query.client.js.JsNodeArray;
+import com.google.gwt.query.client.js.JsObjectArray;
+import com.google.gwt.query.client.js.JsUtils;
import com.google.gwt.query.client.plugins.Effects;
+import com.google.gwt.query.client.plugins.Events;
+import com.google.gwt.query.client.plugins.Plugin;
+import com.google.gwt.query.client.plugins.Widgets;
+import com.google.gwt.query.client.plugins.ajax.Ajax;
+import com.google.gwt.query.client.plugins.ajax.Ajax.Settings;
+import com.google.gwt.query.client.plugins.deferred.Deferred;
import com.google.gwt.query.client.plugins.effects.PropertiesAnimation.Easing;
+import com.google.gwt.query.client.plugins.events.EventsListener;
+import com.google.gwt.query.client.plugins.widgets.WidgetsUtils;
+import com.google.gwt.regexp.shared.RegExp;
+import com.google.gwt.user.client.DOM;
+import com.google.gwt.user.client.Event;
+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.Offset;
+import com.google.gwt.query.client.LazyBase;
public interface LazyGQuery extends LazyBase{
@@ -705,6 +743,7 @@ public interface LazyGQuery extends LazyBase{
*
* $("div.main").delegate(".subMain", Event.ONCLICK | Event.ONDBLCLICK, new Function(){...});
*
+ * @deprecated use {@link #on(String, String, Function...)}
*/
LazyGQuery delegate(String selector, int eventbits, Function... handlers);
@@ -743,6 +782,7 @@ public interface LazyGQuery extends LazyBase{
*
* $("div.main").delegate(".subMain", Event.ONCLICK | Event.ONDBLCLICK, new Function(){...});
*
+ * @deprecated use {@link #on(String, String, Object, Function...)}
*/
LazyGQuery delegate(String selector, int eventbits, Object data, Function... handlers);
@@ -783,6 +823,7 @@ public interface LazyGQuery extends LazyBase{
*
*
*
+ * @deprecated use {@link #on(String, String, Function...)}
*/
LazyGQuery delegate(String selector, String eventType, Function... handlers);
@@ -821,6 +862,7 @@ public interface LazyGQuery extends LazyBase{
*
*
*
+ * @deprecated use {@link #on(String, String, Object, Function...)}
*/
LazyGQuery delegate(String selector, String eventType, Object data, Function... handlers);
@@ -860,6 +902,7 @@ public interface LazyGQuery extends LazyBase{
* Remove all event handlers previously attached using {@link #live(String, Function)}. In order
* for this method to function correctly, the selector used with it must match exactly the
* selector initially used with {@link #live(String, Function)}
+ * @deprecated use {@link #off(String, String)} instead
*/
LazyGQuery die();
@@ -867,6 +910,7 @@ public interface LazyGQuery extends LazyBase{
* Remove an event handlers previously attached using {@link #live(int, Function)} In order for
* this method to function correctly, the selector used with it must match exactly the selector
* initially used with {@link #live(int, Function)}
+ * @deprecated use {@link #off(String)}
*/
LazyGQuery die(int eventbits);
@@ -1118,6 +1162,11 @@ public interface LazyGQuery extends LazyBase{
*/
int index(Element element);
+ /**
+ * Return the position of the first matched element in relation with its sibblings.
+ */
+ int index();
+
/**
* Returns the inner height of the first matched element, including padding but not the vertical
* scrollbar height, border, or margin.
@@ -1237,12 +1286,14 @@ public interface LazyGQuery extends LazyBase{
/**
* Attach a handler for this event to all elements which match the current selector, now and in
* the future.
+ * @deprecated use {@link #on(String, Function...)}
*/
LazyGQuery live(int eventbits, Function... funcs);
/**
* Attach a handler for this event to all elements which match the current selector, now and in
* the future.
+ * @deprecated use {@link #on(String, Object, Function...)}
*/
LazyGQuery live(int eventbits, Object data, Function... funcs);
@@ -1295,6 +1346,7 @@ public interface LazyGQuery extends LazyBase{
* descendant of myElement.
*
*
+ * @deprecated use {@link #on(String, Function...)}
*/
LazyGQuery live(String eventName, Function... funcs);
@@ -1347,6 +1399,7 @@ public interface LazyGQuery extends LazyBase{
* descendant of myElement.
*
*
+ * @deprecated use {@link #on(String, Object, Function...)}
*/
LazyGQuery live(String eventName, Object data, Function... funcs);
@@ -1554,6 +1607,46 @@ public interface LazyGQuery extends LazyBase{
*/
LazyGQuery offsetParent();
+ /**
+ * Attach an event handler function for one or more events to the selected elements.
+ */
+ LazyGQuery on(String eventName, Function... funcs);
+
+ /**
+ * Attach an event handler function for one or more events to the selected elements.
+ */
+ LazyGQuery on(String eventName, Object data, Function... funcs);
+
+ /**
+ * Attach an event handler function for one or more events to the selected elements.
+ */
+ LazyGQuery on(String eventName, String selector, Function... funcs);
+
+ /**
+ * Attach an event handler function for one or more events to the selected elements.
+ */
+ LazyGQuery on(String eventName, String selector, Object data, Function... funcs);
+
+ /**
+ * Remove all event handlers.
+ */
+ LazyGQuery off();
+
+ /**
+ * Remove an event handler
+ */
+ LazyGQuery off(String eventName);
+
+ /**
+ * Remove an event handler
+ */
+ LazyGQuery off(String eventName, Function f);
+
+ /**
+ * Remove an event handler
+ */
+ LazyGQuery off(String eventName, String selector);
+
/**
* Binds a handler to a particular Event (like Event.ONCLICK) for each matched element. The
* handler is executed only once for each element.
@@ -2232,24 +2325,28 @@ public interface LazyGQuery extends LazyBase{
/**
* Remove all event delegation that have been bound using
* {@link #delegate(String, int, Function...)} {@link #live(int, Function...)} methods
+ * @deprecated use {@link #off()}
*/
LazyGQuery undelegate();
/**
* Undelegate is a way of removing event handlers that have been bound using
* {@link #delegate(String, int, Function...)} method
+ * @deprecated use {@link #off(String)}
*/
LazyGQuery undelegate(String selector);
/**
* Undelegate is a way of removing event handlers that have been bound using
* {@link #delegate(String, int, Function...)} method
+ * @deprecated use {@link #off(String)}
*/
LazyGQuery undelegate(String selector, int eventBit);
/**
* Undelegate is a way of removing event handlers that have been bound using
* {@link #delegate(String, int, Function...)} method
+ * @deprecated use {@link #off(String, String)}
*/
LazyGQuery undelegate(String selector, String eventName);
diff --git a/gwtquery-core/src/main/java/com/google/gwt/query/client/plugins/LazyEffects.java b/gwtquery-core/src/main/java/com/google/gwt/query/client/plugins/LazyEffects.java
index 2a921a4e..b59ebeb2 100644
--- a/gwtquery-core/src/main/java/com/google/gwt/query/client/plugins/LazyEffects.java
+++ b/gwtquery-core/src/main/java/com/google/gwt/query/client/plugins/LazyEffects.java
@@ -25,6 +25,7 @@ import com.google.gwt.query.client.plugins.effects.Fx;
import com.google.gwt.query.client.plugins.effects.PropertiesAnimation.Easing;
import com.google.gwt.query.client.plugins.effects.PropertiesAnimation.EasingCurve;
import com.google.gwt.query.client.plugins.effects.TransitionsAnimation.TransitionsClipAnimation;
+import com.google.gwt.query.client.GQuery.Offset;
import com.google.gwt.query.client.LazyBase;
public interface LazyEffects extends LazyBase{
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 c0689af6..1d84d8a6 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
@@ -23,6 +23,7 @@ import com.google.gwt.query.client.plugins.events.EventsListener;
import com.google.gwt.query.client.plugins.events.EventsListener.SpecialEvent;
import com.google.gwt.query.client.plugins.events.GqEvent;
import com.google.gwt.user.client.Event;
+import com.google.gwt.query.client.GQuery.Offset;
import com.google.gwt.query.client.LazyBase;
public interface LazyEvents extends LazyBase{
@@ -153,6 +154,8 @@ public interface LazyEvents extends LazyBase{
*/
LazyEvents unbind(int eventbits);
+ LazyEvents off();
+
/**
* Removes all handlers, that matches the events bits and the namespace passed, from each element.
*
diff --git a/gwtquery-core/src/main/java/com/google/gwt/query/client/plugins/LazyWidgets.java b/gwtquery-core/src/main/java/com/google/gwt/query/client/plugins/LazyWidgets.java
index 5fe7de8b..c678c8f1 100644
--- a/gwtquery-core/src/main/java/com/google/gwt/query/client/plugins/LazyWidgets.java
+++ b/gwtquery-core/src/main/java/com/google/gwt/query/client/plugins/LazyWidgets.java
@@ -33,6 +33,7 @@ import com.google.gwt.user.client.ui.PasswordTextBox;
import com.google.gwt.user.client.ui.TextArea;
import com.google.gwt.user.client.ui.TextBox;
import com.google.gwt.user.client.ui.Widget;
+import com.google.gwt.query.client.GQuery.Offset;
import com.google.gwt.query.client.LazyBase;
public interface LazyWidgets extends LazyBase{
--
cgit v1.2.3