diff options
author | Manolo Carrasco <manolo@apache.org> | 2014-02-02 07:34:58 +0100 |
---|---|---|
committer | Manolo Carrasco <manolo@apache.org> | 2014-02-02 07:34:58 +0100 |
commit | 96705cf9e96e8e78771bfd4376cca90d00f4fbc8 (patch) | |
tree | cb5e65c6307912822c17fb8dc960260af6cf1156 | |
parent | 30352ce90c8bded13ad5129ac03f2c2a32949a21 (diff) | |
download | gwtquery-96705cf9e96e8e78771bfd4376cca90d00f4fbc8.tar.gz gwtquery-96705cf9e96e8e78771bfd4376cca90d00f4fbc8.zip |
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
7 files changed, 15 insertions, 7 deletions
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 .= "<T> extends LazyBase<T>" 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 extends JsonBuilder> T as (Class<T> 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<T> extends LazyBase<T>{ 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<T> extends LazyBase<T>{ 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<T> extends LazyBase<T>{ 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<T> extends LazyBase<T>{ |