From 3174d5ba98027c8d106d252747f5c1e1205f8fe2 Mon Sep 17 00:00:00 2001 From: Manolo Carrasco Date: Tue, 13 Jan 2015 08:14:49 +0100 Subject: Remove most of $ constructors in favour of $(Object) to avoid java8 disambiguation. Fixes issue 335 --- .../java/com/google/gwt/query/client/GQuery.java | 107 ++++++--------------- .../com/google/gwt/query/client/js/JsUtils.java | 2 +- 2 files changed, 33 insertions(+), 76 deletions(-) diff --git a/gwtquery-core/src/main/java/com/google/gwt/query/client/GQuery.java b/gwtquery-core/src/main/java/com/google/gwt/query/client/GQuery.java index 92641bf8..367d956a 100644 --- a/gwtquery-core/src/main/java/com/google/gwt/query/client/GQuery.java +++ b/gwtquery-core/src/main/java/com/google/gwt/query/client/GQuery.java @@ -206,59 +206,6 @@ public class GQuery implements Lazy { return new GQuery(JsNodeArray.create()); } - /** - * Wrap a GQuery around an existing element. - */ - public static GQuery $(Element element) { - return new GQuery(element); - } - - /** - * Wrap a GQuery around an event's target element. - */ - public static GQuery $(Event event) { - return event == null ? $() : $((Element) event.getCurrentEventTarget().cast()); - } - - /** - * Wrap a GQuery around the element of a Function callback. - */ - public static GQuery $(Function f) { - return $(f.getElement()); - } - - /** - * Wrap a GQuery around an existing javascript element, event, node, nodelist, function or array. - */ - public static GQuery $(JavaScriptObject jso) { - if (jso == null) { - return $(); - } - // Execute a native javascript function like jquery does - if (JsUtils.isFunction(jso)) { - new JsUtils.JsFunction(jso).fe(); - return $(); - } - // Wraps a native array like jquery does - if (!JsUtils.isWindow(jso) && !JsUtils.isElement(jso) && JsUtils.isArray(jso)) { - JsArrayMixed c = jso.cast(); - JsNodeArray elms = JsNodeArray.create(); - for (int i = 0; i < c.length(); i++) { - Object obj = c.getObject(i); - if (obj instanceof Node) { - elms.addNode((Node) obj); - } - } - return $(elms); - } - - return JsUtils.isWindow(jso) ? $(jso. cast()) : - JsUtils.isElement(jso) ? $(jso. cast()) : - JsUtils.isEvent(jso) ? $(jso. cast()) : - JsUtils.isNodeList(jso) ? $(jso.> cast()) : - $(jso. cast()); - } - /** * Wrap a GQuery around any object, supported objects are: * String, GQuery, Function, Widget, JavaScriptObject. @@ -268,7 +215,7 @@ public class GQuery implements Lazy { * selector is supported in browsers with native xpath engine. * * In the case of a JavaScriptObject we handle: - * Element, Event, Node, Nodelist and native functions or arrays. + * Element, Event, Node, Nodelist, Function, and native functions or arrays. * * If the case of a native function, we execute it and return empty. */ @@ -281,20 +228,44 @@ public class GQuery implements Lazy { return (GQuery) o; } if (o instanceof Function) { - return $((Function) o); - } - if (JsUtils.isElement(o)) { - return $(JsUtils. cast(o)); + return new GQuery(((Function) o).getElement()); } if (o instanceof JsonBuilder) { return new GQuery(((JsonBuilder) o).getDataImpl()); } - if (o instanceof JavaScriptObject) { - return $((JavaScriptObject) o); - } if (o instanceof IsWidget) { return $(Arrays.asList(o)); } + if (o instanceof JavaScriptObject) { + JavaScriptObject jso = (JavaScriptObject) o; + // Execute a native javascript function like jquery does + if (JsUtils.isFunction(jso)) { + new JsUtils.JsFunction(jso).fe(); + return $(); + } + // Wraps a native array like jquery does + if (!JsUtils.isWindow(jso) && !JsUtils.isElement(jso) && JsUtils.isArray(jso)) { + JsArrayMixed c = jso.cast(); + JsNodeArray elms = JsNodeArray.create(); + for (int i = 0; i < c.length(); i++) { + Object obj = c.getObject(i); + if (obj instanceof Node) { + elms.addNode((Node) obj); + } + } + return new GQuery(elms); + } + // Wraps a native NodeList + if (JsUtils.isNodeList(jso)) { + return new GQuery(jso.> cast()); + } + // Wraps an event + if (JsUtils.isEvent(jso)) { + jso = jso.cast().getCurrentEventTarget(); + } + // Otherwise we wrap it as an element + return new GQuery(jso. cast()); + } console .log("Error: GQuery.$(Object o) could not wrap the type : ", o.getClass().getName(), o); } @@ -319,20 +290,6 @@ public class GQuery implements Lazy { return new GQuery(elms); } - /** - * Wrap a GQuery around an existing node. - */ - public static GQuery $(Node n) { - return $((Element) n); - } - - /** - * Wrap a GQuery around existing Elements. - */ - public static GQuery $(NodeList elms) { - return new GQuery(elms); - } - /** * This function accepts a string containing a CSS selector which is then used to match a set of * elements, or it accepts raw HTML creating a GQuery element containing those elements. Xpath diff --git a/gwtquery-core/src/main/java/com/google/gwt/query/client/js/JsUtils.java b/gwtquery-core/src/main/java/com/google/gwt/query/client/js/JsUtils.java index 1012a8dc..e4acf8ee 100644 --- a/gwtquery-core/src/main/java/com/google/gwt/query/client/js/JsUtils.java +++ b/gwtquery-core/src/main/java/com/google/gwt/query/client/js/JsUtils.java @@ -410,7 +410,7 @@ public class JsUtils { public static native boolean isNodeList(JavaScriptObject o) /*-{ var r = Object.prototype.toString.call(o); return r == '[object HTMLCollection]' || r == '[object NodeList]' - || (typeof o == 'object' && o.length && o[0].tagName) ? true : false; + || (typeof o == 'object' && o.length && o[0] && o[0].tagName) ? true : false; }-*/; /** -- cgit v1.2.3 From 1105ed0acb5b3111c6c711fe481372b1f7f3687e Mon Sep 17 00:00:00 2001 From: Manolo Carrasco Date: Thu, 26 Feb 2015 10:04:47 +0100 Subject: Simplify Json generated classes reusing common code --- .../google/gwt/query/client/builders/JsonBuilderBase.java | 14 ++++++++++++++ .../com/google/gwt/query/rebind/JsonBuilderGenerator.java | 15 +++------------ .../gwt/query/client/dbinding/DataBindingTestJre.java | 5 +++++ 3 files changed, 22 insertions(+), 12 deletions(-) diff --git a/gwtquery-core/src/main/java/com/google/gwt/query/client/builders/JsonBuilderBase.java b/gwtquery-core/src/main/java/com/google/gwt/query/client/builders/JsonBuilderBase.java index f0c46931..996f245c 100644 --- a/gwtquery-core/src/main/java/com/google/gwt/query/client/builders/JsonBuilderBase.java +++ b/gwtquery-core/src/main/java/com/google/gwt/query/client/builders/JsonBuilderBase.java @@ -17,6 +17,8 @@ package com.google.gwt.query.client.builders; 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.query.client.GQ; import com.google.gwt.query.client.IsProperties; import com.google.gwt.query.client.Properties; import com.google.gwt.query.client.js.JsCache; @@ -107,6 +109,18 @@ public abstract class JsonBuilderBase> implements J return r; } + protected final T[] getIsPropertiesArrayBase(JsArrayMixed js, T[] r, Class clazz) { + JsObjectArray a1 = js.cast(); + for (int i = 0; i < r.length; i++) { + r[i] = getIsPropertiesBase(a1.get(i), clazz); + } + return r; + } + + protected final T getIsPropertiesBase(Object o, Class clazz) { + return GQ.create(clazz).load(o); + } + protected Properties getPropertiesBase(String n) { if (p.getJavaScriptObject(n) == null) { p.set(n, Properties.create()); diff --git a/gwtquery-core/src/main/java/com/google/gwt/query/rebind/JsonBuilderGenerator.java b/gwtquery-core/src/main/java/com/google/gwt/query/rebind/JsonBuilderGenerator.java index 08e40c24..e30b7588 100644 --- a/gwtquery-core/src/main/java/com/google/gwt/query/rebind/JsonBuilderGenerator.java +++ b/gwtquery-core/src/main/java/com/google/gwt/query/rebind/JsonBuilderGenerator.java @@ -183,8 +183,7 @@ public class JsonBuilderGenerator extends Generator { sw.println("return p.getStr(\"" + name + "\");"); } else if (isTypeAssignableTo(method.getReturnType(), jsonBuilderType)) { String q = method.getReturnType().getQualifiedSourceName(); - sw.println("return " + "((" + q + ")GWT.create(" + q + ".class))" - + ".load(getPropertiesBase(\"" + name + "\"));"); + sw.println("return " + "getIsPropertiesBase(getPropertiesBase(\"" + name + "\")," + q + ".class);"); } else if (isTypeAssignableTo(method.getReturnType(), settingsType)) { String q = method.getReturnType().getQualifiedSourceName(); sw.println("return " + "((" + q + ")getPropertiesBase(\"" + name + "\"));"); @@ -203,16 +202,7 @@ public class JsonBuilderGenerator extends Generator { sw.println("int l = a == null ? 0 : a.length();"); String ret; if (buildType) { - sw.println(t + "[] r = new " + t + "[l];"); - sw.println("JsObjectArray a1 = p.getArray(\"" + name - + "\").cast();"); - sw.println("int l1 = r.length;"); - sw.println("for (int i = 0 ; i < l1 ; i++) {"); - sw.println(" Object w = a1.get(i);"); - sw.println(" " + t + " instance = GWT.create(" + t + ".class);"); - sw.println(" r[i] = instance.load(w);"); - sw.println("}"); - ret = "r"; + ret = "getIsPropertiesArrayBase(a, new " + t + "[l], " + t + ".class)"; } else { ret = "getArrayBase(\"" + name + "\", new " + t + "[l], " + t + ".class)"; } @@ -326,6 +316,7 @@ public class JsonBuilderGenerator extends Generator { types.add(t); } } + sw.println("GQuery.console.error(\"GQ.create: not registered class :\" + clz);"); sw.println("return null;"); sw.outdent(); sw.println("}"); diff --git a/gwtquery-core/src/test/java/com/google/gwt/query/client/dbinding/DataBindingTestJre.java b/gwtquery-core/src/test/java/com/google/gwt/query/client/dbinding/DataBindingTestJre.java index 50123b80..01b93bfd 100644 --- a/gwtquery-core/src/test/java/com/google/gwt/query/client/dbinding/DataBindingTestJre.java +++ b/gwtquery-core/src/test/java/com/google/gwt/query/client/dbinding/DataBindingTestJre.java @@ -81,6 +81,8 @@ public class DataBindingTestJre extends GWTTestCase { Boolean getZ(); String[] getT(); JsonExample setT(String[] strings); + Item[] getIt(); + JsonExample setIt(Item[] items); JsonExample setZ(Boolean b); JsonExample setD(long l); List getItems(); @@ -139,6 +141,9 @@ public class DataBindingTestJre extends GWTTestCase { Item i2 = GQ.create(Item.class); i2.setDate(new Date(3000)); Item[] items = new Item[]{i1, i2}; + c.setIt(items); + assertEquals(2000l, c.getIt()[0].getDate().getTime()); + assertEquals(3000l, c.getIt()[1].getDate().getTime()); c.setItems(Arrays.asList(items)); assertEquals(2000l, c.getItems().get(0).getDate().getTime()); assertEquals(3000l, c.getItems().get(1).getDate().getTime()); -- cgit v1.2.3 From 2960f96c497f75883a8e03b5983ddd10ed570caf Mon Sep 17 00:00:00 2001 From: Raphaƫl Garnier Date: Mon, 23 Feb 2015 23:33:07 +0100 Subject: Use absolute path to load library in JsniBundle As ClientBundle do, it's now possible to use relative or absolute path to load js libraries in JsniBundle. --- .../java/com/google/gwt/query/rebind/JsniBundleGenerator.java | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/gwtquery-core/src/main/java/com/google/gwt/query/rebind/JsniBundleGenerator.java b/gwtquery-core/src/main/java/com/google/gwt/query/rebind/JsniBundleGenerator.java index cfd9893e..eb1511e4 100644 --- a/gwtquery-core/src/main/java/com/google/gwt/query/rebind/JsniBundleGenerator.java +++ b/gwtquery-core/src/main/java/com/google/gwt/query/rebind/JsniBundleGenerator.java @@ -131,11 +131,16 @@ public class JsniBundleGenerator extends Generator { try { if (!src.matches("(?i)https?://.*")) { String file = path + "/" + src; - logger.log(TreeLogger.INFO, getClass().getSimpleName() - + " - importing external javascript: " + file); - in = this.getClass().getClassLoader().getResourceAsStream(file); if (in == null) { + // If we didn't find the resource relative to the package, assume it is absolute. + file = src; + in = this.getClass().getClassLoader().getResourceAsStream(file); + } + if (in != null) { + logger.log(TreeLogger.INFO, getClass().getSimpleName() + + " - importing external javascript: " + file); + } else { logger.log(TreeLogger.ERROR, "Unable to read javascript file: " + file); } } else { -- cgit v1.2.3 From bd4a583480c7940459f5c489487fa8232dfb13e8 Mon Sep 17 00:00:00 2001 From: Manolo Carrasco Date: Fri, 6 Mar 2015 19:57:16 +0100 Subject: Add utility method to run a native JS function --- .../src/main/java/com/google/gwt/query/client/js/JsUtils.java | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/gwtquery-core/src/main/java/com/google/gwt/query/client/js/JsUtils.java b/gwtquery-core/src/main/java/com/google/gwt/query/client/js/JsUtils.java index e4acf8ee..7817bcab 100644 --- a/gwtquery-core/src/main/java/com/google/gwt/query/client/js/JsUtils.java +++ b/gwtquery-core/src/main/java/com/google/gwt/query/client/js/JsUtils.java @@ -228,6 +228,14 @@ public class JsUtils { } } + /** + * Execute a native javascript function. + */ + public static T exec(JavaScriptObject jsFunction, Object... args) { + assert isFunction(jsFunction); + return jsni(jsFunction, "call", jsFunction, args); + } + /** * Assign a function to a property of the window object. */ -- cgit v1.2.3 From f3c92755f53a72180469b2220da5d9b017112ec9 Mon Sep 17 00:00:00 2001 From: Manolo Carrasco Date: Tue, 10 Mar 2015 10:20:17 +0100 Subject: Fix a disanbiguity introduced with SafeHtml patch When using gwt-2.8.0 and java8 gwt compiler is more restrictive and when you override a method(Object) with certain classes like Interfaces or JSO, there is an error like: The method $(Object) is ambiguous for the type GQuery. Also updated lazy interface with new methods. --- .../java/com/google/gwt/query/client/GQuery.java | 12 ++-- .../com/google/gwt/query/client/LazyGQuery.java | 68 ++++++++++++++++++++++ 2 files changed, 72 insertions(+), 8 deletions(-) diff --git a/gwtquery-core/src/main/java/com/google/gwt/query/client/GQuery.java b/gwtquery-core/src/main/java/com/google/gwt/query/client/GQuery.java index a4b92733..4ed7cad8 100644 --- a/gwtquery-core/src/main/java/com/google/gwt/query/client/GQuery.java +++ b/gwtquery-core/src/main/java/com/google/gwt/query/client/GQuery.java @@ -225,6 +225,9 @@ public class GQuery implements Lazy { if (o instanceof String) { return $((String) o); } + if (o instanceof SafeHtml) { + return $(((SafeHtml) o).asString()); + } if (o instanceof GQuery) { return (GQuery) o; } @@ -300,13 +303,6 @@ public class GQuery implements Lazy { return $(selectorOrHtml, document); } - /** - * This function accepts a SafeHtml creating a GQuery element containing those elements. - */ - public static GQuery $(SafeHtml safeHtml) { - return $(safeHtml.asString()); - } - /** * This function accepts a string containing a CSS selector which is then used to match a set of * elements, or it accepts raw HTML creating a GQuery element containing those elements. The @@ -4941,7 +4937,7 @@ public class GQuery implements Lazy { * its structure -- it is that element that will enwrap everything else. */ public GQuery wrap(SafeHtml safeHtml) { - return wrap(safeHtml.asString()); + return wrap($(safeHtml)); } /** 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 df766f9a..c9f43345 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 @@ -25,6 +25,7 @@ import com.google.gwt.query.client.js.JsNamedArray; import com.google.gwt.query.client.js.JsNodeArray; import com.google.gwt.query.client.plugins.Effects; import com.google.gwt.query.client.plugins.effects.PropertiesAnimation.Easing; +import com.google.gwt.safehtml.shared.SafeHtml; import com.google.gwt.user.client.ui.Widget; import java.util.List; @@ -78,6 +79,12 @@ public interface LazyGQuery extends LazyBase { */ LazyGQuery after(String html); + /** + * Insert content after each of the matched elements. The elements must already be inserted into + * the document (you can't insert an element after another if it's not in the page). + */ + LazyGQuery after(SafeHtml safeHtml); + /** * * The animate() method allows you to create animation effects on any numeric HTML Attribute, @@ -264,6 +271,12 @@ public interface LazyGQuery extends LazyBase { */ LazyGQuery append(String html); + /** + * Append content to the inside of every matched element. This operation is similar to doing an + * appendChild to all the specified elements, adding them into the document. + */ + LazyGQuery append(SafeHtml safeHtml); + /** * All of the matched set of elements will be inserted at the end of the element(s) specified by * the parameter other. @@ -291,6 +304,15 @@ public interface LazyGQuery extends LazyBase { */ LazyGQuery appendTo(String html); + /** + * All of the matched set of elements will be inserted at the end of the element(s) specified by + * the parameter other. + * + * The operation $(A).appendTo(B) is, essentially, the reverse of doing a regular $(A).append(B), + * instead of appending B to A, you're appending A to B. + */ + LazyGQuery appendTo(SafeHtml safeHtml); + /** * Convert to Plugin interface provided by Class literal. */ @@ -1122,6 +1144,11 @@ public interface LazyGQuery extends LazyBase { */ LazyGQuery html(String html); + /** + * Set the innerHTML of every matched element. + */ + LazyGQuery html(SafeHtml safeHtml); + /** * Get the id of the first matched element. */ @@ -1940,6 +1967,16 @@ public interface LazyGQuery extends LazyBase { */ LazyGQuery queue(String queueName, Function... f); + /** + * Specify a function to execute when the DOM is fully loaded. + * + * While JavaScript provides the load event for executing code when a page is rendered, this event + * is not seen if we attach an event listener after the document has been loaded. + * This guarantees that our gwt code will be executed either it's executed synchronously before the + * DOM has been rendered (ie: single script linker in header) or asynchronously. + */ + Promise ready(Function... fncs); + /** * Removes all matched elements from the DOM. */ @@ -2489,6 +2526,15 @@ public interface LazyGQuery extends LazyBase { */ LazyGQuery wrap(String html); + /** + * Wrap each matched element with the specified SafeHtml content. This wrapping process is most useful + * for injecting additional structure into a document, without ruining the original semantic + * qualities of a document. This works by going through the first element provided (which is + * generated, on the fly, from the provided SafeHtml) and finds the deepest descendant element within + * its structure -- it is that element that will enwrap everything else. + */ + LazyGQuery wrap(SafeHtml safeHtml); + /** * Wrap all the elements in the matched set into a single wrapper element. This is different from * .wrap() where each element in the matched set would get wrapped with an element. This wrapping @@ -2525,6 +2571,18 @@ public interface LazyGQuery extends LazyBase { */ LazyGQuery wrapAll(String html); + /** + * Wrap all the elements in the matched set into a single wrapper element. This is different from + * .wrap() where each element in the matched set would get wrapped with an element. This wrapping + * process is most useful for injecting additional structure into a document, without ruining the + * original semantic qualities of a document. + * + * This works by going through the first element provided (which is generated, on the fly, from + * the provided SafeHtml) and finds the deepest descendant element within its structure -- it is that + * element that will enwrap everything else. + */ + LazyGQuery wrapAll(SafeHtml safeHtml); + /** * Wrap the inner child contents of each matched element (including text nodes) with an HTML * structure. This wrapping process is most useful for injecting additional structure into a @@ -2555,4 +2613,14 @@ public interface LazyGQuery extends LazyBase { */ LazyGQuery wrapInner(String html); + /** + * Wrap the inner child contents of each matched element (including text nodes) with an SafeHtml + * structure. This wrapping process is most useful for injecting additional structure into a + * document, without ruining the original semantic qualities of a document. This works by going + * through the first element provided (which is generated, on the fly, from the provided SafeHtml) and + * finds the deepest ancestor element within its structure -- it is that element that will enwrap + * everything else. + */ + LazyGQuery wrapInner(SafeHtml safeHtml); + } -- cgit v1.2.3 From 178fffc506ebeda6a15bda5ad3bcb21782419385 Mon Sep 17 00:00:00 2001 From: Manolo Carrasco Date: Wed, 22 Apr 2015 12:32:23 +0200 Subject: HasAttribute should only check nullity --- gwtquery-core/src/main/java/com/google/gwt/query/client/js/JsUtils.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/gwtquery-core/src/main/java/com/google/gwt/query/client/js/JsUtils.java b/gwtquery-core/src/main/java/com/google/gwt/query/client/js/JsUtils.java index 7817bcab..a8e54995 100644 --- a/gwtquery-core/src/main/java/com/google/gwt/query/client/js/JsUtils.java +++ b/gwtquery-core/src/main/java/com/google/gwt/query/client/js/JsUtils.java @@ -342,7 +342,7 @@ public class JsUtils { * present. */ public static native boolean hasAttribute(Element o, String name) /*-{ - return !!(o && o.getAttribute(name)); + return !!(o && o.getAttribute(name) !== null); }-*/; /** -- cgit v1.2.3 From 83288de9a24fd7f65e9e731c90cee1651f62bd85 Mon Sep 17 00:00:00 2001 From: Manolo Carrasco Date: Sat, 23 May 2015 15:49:26 +0200 Subject: Fix JsInterop in 2.8-SNAPSHOT --- .../java/com/google/gwt/query/client/GQueryJsInteropTestGwt.java | 8 ++++---- pom.xml | 4 ++-- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/gwtquery-core/src/test/java/com/google/gwt/query/client/GQueryJsInteropTestGwt.java b/gwtquery-core/src/test/java/com/google/gwt/query/client/GQueryJsInteropTestGwt.java index 1a3ebf68..a01a9923 100644 --- a/gwtquery-core/src/test/java/com/google/gwt/query/client/GQueryJsInteropTestGwt.java +++ b/gwtquery-core/src/test/java/com/google/gwt/query/client/GQueryJsInteropTestGwt.java @@ -58,23 +58,23 @@ public class GQueryJsInteropTestGwt extends GWTTestCase { } } - @JsType(prototype = "Window", isNative = true) + @JsType(prototype = "Window") public interface HTMLWindow { @JsProperty String getName(); @JsProperty void setName(String name); } - @JsType(prototype = "Window", isNative = true) + @JsType(prototype = "Window") public interface HWindow { @JsProperty HDocument document(); } - @JsType(prototype = "HTMLDocument", isNative = false) + @JsType(prototype = "HTMLDocument") public interface HDocument { HElement createElement(String tag); } - @JsType(prototype = "HTMLElement", isNative = false) + @JsType(prototype = "HTMLElement") public interface HElement { @JsProperty void id(String s); } diff --git a/pom.xml b/pom.xml index ae507dda..db200cfc 100644 --- a/pom.xml +++ b/pom.xml @@ -146,8 +146,8 @@ - 2.7.0 - 2.7.0 + 2.8.0-SNAPSHOT + 2.8.0-SNAPSHOT INFO OBF -- cgit v1.2.3 From 0a8f1e1925f5c8520f726c1dd30b2c33a450ae4d Mon Sep 17 00:00:00 2001 From: Manolo Carrasco Date: Fri, 10 Jul 2015 22:20:33 +0200 Subject: Throw an exception when wrapped object is unknown. --- gwtquery-core/src/main/java/com/google/gwt/query/client/GQuery.java | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/gwtquery-core/src/main/java/com/google/gwt/query/client/GQuery.java b/gwtquery-core/src/main/java/com/google/gwt/query/client/GQuery.java index 4ed7cad8..736f024a 100644 --- a/gwtquery-core/src/main/java/com/google/gwt/query/client/GQuery.java +++ b/gwtquery-core/src/main/java/com/google/gwt/query/client/GQuery.java @@ -270,8 +270,7 @@ public class GQuery implements Lazy { // Otherwise we wrap it as an element return new GQuery(jso. cast()); } - console - .log("Error: GQuery.$(Object o) could not wrap the type : ", o.getClass().getName(), o); + throw new RuntimeException("Error: GQuery.$(Object o) could not wrap the type : " + o.getClass().getName() + " " + o); } return $(); } -- cgit v1.2.3 From eeb63fc6b289e9b6c016b21a086fdc389973f34e Mon Sep 17 00:00:00 2001 From: Manolo Carrasco Date: Mon, 20 Jul 2015 09:47:13 +0200 Subject: Add google snapshot site --- pom.xml | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/pom.xml b/pom.xml index db200cfc..5b4cb5b2 100644 --- a/pom.xml +++ b/pom.xml @@ -139,6 +139,12 @@ true false + + google-snapshots + http://oss.sonatype.org/content/repositories/google-snapshots + true + true + gwtquery-plugins http://gwtquery-plugins.googlecode.com/svn/mavenrepo -- cgit v1.2.3