From: Manolo Carrasco Date: Sun, 2 Feb 2014 06:34:58 +0000 (+0100) Subject: Changing script to generate lazy interfaces so as plugins could import any class... X-Git-Tag: gwtquery-project-1.4.3~44^2 X-Git-Url: https://source.dussan.org/?a=commitdiff_plain;h=96705cf9e96e8e78771bfd4376cca90d00f4fbc8;p=gwtquery.git Changing script to generate lazy interfaces so as plugins could import any class defined in GQuery class without compilation errors. Adding missing javadoc for public interface method. Overloading method in Properties so as the user could set the serialization name in case --- diff --git a/extractInterface.pl b/extractInterface.pl index 0414e373..c1b1e6b5 100644 --- a/extractInterface.pl +++ b/extractInterface.pl @@ -76,7 +76,7 @@ close(F); my $class = "public interface $oclass"; if ($lazy) { $class .= " extends LazyBase" if ($lazy); - $head .= "import com.google.gwt.query.client.GQuery.Offset;\n"; + $head .= "import com.google.gwt.query.client.GQuery.*;\n"; $head .= "import com.google.gwt.query.client.LazyBase;\n\n"; } diff --git a/gwtquery-core/src/main/java/com/google/gwt/query/client/IsProperties.java b/gwtquery-core/src/main/java/com/google/gwt/query/client/IsProperties.java index f973afb0..bcd79cdb 100644 --- a/gwtquery-core/src/main/java/com/google/gwt/query/client/IsProperties.java +++ b/gwtquery-core/src/main/java/com/google/gwt/query/client/IsProperties.java @@ -66,7 +66,7 @@ public interface IsProperties { * Example {"user":{"name":"manolo","surname":"carrasco"}} */ String toJsonWithName(); - + /** * return a string which represents the object in a queryString format. */ @@ -78,5 +78,9 @@ public interface IsProperties { String getJsonName(); + /** + * converts a JsonBuilder instance into another JsonBuilder type but + * preserving the underlying data object. + */ T as (Class clz); } 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 958ed2a8..804e533b 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 @@ -65,7 +65,7 @@ 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.GQuery.*; import com.google.gwt.query.client.LazyBase; public interface LazyGQuery extends LazyBase{ diff --git a/gwtquery-core/src/main/java/com/google/gwt/query/client/Properties.java b/gwtquery-core/src/main/java/com/google/gwt/query/client/Properties.java index ce703aed..ed39d4eb 100644 --- a/gwtquery-core/src/main/java/com/google/gwt/query/client/Properties.java +++ b/gwtquery-core/src/main/java/com/google/gwt/query/client/Properties.java @@ -223,7 +223,11 @@ public class Properties extends JavaScriptObject implements IsProperties { } public final String toJsonWithName() { - return "{\"properties\":{" + toJson() + "}"; + return toJsonWithName(getJsonName()); + } + + public final String toJsonWithName(String name) { + return "{\"" + name + "\":{" + toJson() + "}"; } @SuppressWarnings("unchecked") 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 b59ebeb2..cf62be4f 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,7 +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.GQuery.*; 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 1d84d8a6..37244237 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,7 +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.GQuery.*; import com.google.gwt.query.client.LazyBase; public interface LazyEvents extends LazyBase{ 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 c678c8f1..8c40c293 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,7 +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.GQuery.*; import com.google.gwt.query.client.LazyBase; public interface LazyWidgets extends LazyBase{