List of usage examples for com.google.gwt.core.client JavaScriptObject createArray
public static native JavaScriptObject createArray() ;
From source file:com.alkacon.vie.client.Vie.java
License:Open Source License
/** * Returns a list of elements matching the given CSS selector.<p> * /*ww w.j av a 2 s . c o m*/ * @param selector the selector * @param context the context element, if <code>null</code> the body element is used as context * * @return the element list */ public List<Element> select(String selector, Element context) { JsArray<Element> results = JavaScriptObject.createArray().cast(); if (context == null) { context = RootPanel.getBodyElement(); } results = select(selector, context, results); List<Element> elements = new ArrayList<Element>(); for (int i = 0; i < results.length(); i++) { elements.add(results.get(i)); } return elements; }
From source file:com.appkit.collection.client.JsLightArray.java
License:Apache License
/** * Construct a {@link JsLightArray} */ public JsLightArray() { this(JavaScriptObject.createArray()); }
From source file:com.appkit.collection.client.JsLightArrayBoolean.java
License:Apache License
/** * Construct a {@link JsLightArrayBoolean} */ public JsLightArrayBoolean() { this(JavaScriptObject.createArray()); }
From source file:com.appkit.collection.client.JsLightArrayInteger.java
License:Apache License
/** * Construct a {@link JsLightArrayInteger} */ public JsLightArrayInteger() { this(JavaScriptObject.createArray()); }
From source file:com.bedatadriven.rebar.sql.client.websql.WebSqlTransaction.java
License:Apache License
public void executeSql(String statement, WebSqlResultCallback resultCallback) { WebSqlLogger.INSTANCE.fine("WebSql: Queuing statement '" + statement + "' with no parameters"); executeSql(statement, JavaScriptObject.createArray(), resultCallback); }
From source file:com.brazoft.foundation.gwt.client.util.MessageFormat.java
License:Apache License
public static <T> String format(final String pattern, final T... args) { if (null == args || 0 == args.length) return pattern; JsArrayString array = JavaScriptObject.createArray().cast(); for (Object arg : args) { array.push(String.valueOf(arg)); }// w ww .j a v a2 s. c o m return nativeFormat(pattern, array); }
From source file:com.cgxlib.xq.client.builders.JsonBuilderBase.java
License:Apache License
protected <T> void setArrayBase(String n, T[] r) { if (r.length > 0 && r[0] instanceof JsonBuilder) { JsArray<JavaScriptObject> a = JavaScriptObject.createArray().cast(); for (T o : r) { a.push(((JsonBuilder) o).<Properties>getDataImpl()); }/*w w w . j a va 2 s.c om*/ p.set(n, a); } else { JsObjectArray<Object> a = JsObjectArray.create(); a.add(r); p.set(n, a); } }
From source file:com.cgxlib.xq.client.impl.research.SelectorEngineJS.java
License:Apache License
private static NodeList<Element> getElementsByTagName(String tag, Node ctx) { if (ctx == null) { return JavaScriptObject.createArray().cast(); }//from www .j a v a 2 s . co m return ((Element) ctx).getElementsByTagName(tag); }
From source file:com.cgxlib.xq.client.impl.research.SelectorEngineSizzleGwt.java
License:Apache License
public NodeList<Element> select(String selector, Node context) { JsArray<Element> results = JavaScriptObject.createArray().cast(); return JsUtils.unique(select(selector, context, results, null)).cast(); }
From source file:com.cgxlib.xq.client.impl.SelectorEngineSizzle.java
License:Apache License
public NodeList<Element> select(String selector, Node context) { JsArray<Element> results = JavaScriptObject.createArray().cast(); return select(selector, context, results, null).cast(); }