Example usage for com.google.gwt.core.client JavaScriptObject createArray

List of usage examples for com.google.gwt.core.client JavaScriptObject createArray

Introduction

In this page you can find the example usage for com.google.gwt.core.client JavaScriptObject createArray.

Prototype

public static native JavaScriptObject createArray() ;

Source Link

Document

Returns a new array.

Usage

From source file:org.gwtnode.modules.helenus.Connection.java

License:Apache License

/**
 * Executes a CQL Query Against the DB./*from   w  ww . j  a v a  2  s . c o  m*/
 * 
 * @param query
 *          A string representation of the parameterless query: 'select * from MyCf'
 * @param callback
 *          The callback function for the results
 */
@GwtNodeFunction
public final void cql(String query, ResultEventHandler callback) {
    JsArrayMixed args = JavaScriptObject.createArray().cast();
    cql(query, args, callback != null ? callback.getNativeFunction() : null);
}

From source file:org.gwtnode.modules.helenus.JsUtils.java

License:Apache License

public static JsArrayMixed asJSOArray(Object... value) {
    JsArrayMixed result = JavaScriptObject.createArray().cast();
    for (Object item : value)
        result.push(asJSO(item));/*from   w  w w  .ja  v  a  2  s  .  com*/
    return result;
}

From source file:org.gwtnode.modules.helenus.JsUtils.java

License:Apache License

public static JsArrayMixed asJSOArray(Iterable<?> value) {
    JsArrayMixed result = JavaScriptObject.createArray().cast();
    for (Object item : value)
        result.push(asJSO(item));//from  w  ww .ja  v  a  2s .c  om
    return result;
}

From source file:org.gwtnode.modules.mysql.Connection.java

License:Apache License

private static final JavaScriptObject asJSOArray(Object[] value) {
    JsArray<JavaScriptObject> result = JavaScriptObject.createArray().cast();
    for (Object item : value)
        result.push(asJSO(item));/*w w  w.  j  av  a  2 s .  c  o m*/
    return result;
}

From source file:org.gwtnode.modules.mysql.Connection.java

License:Apache License

private static final JavaScriptObject asJSOArray(Iterable<?> value) {
    JsArray<JavaScriptObject> result = JavaScriptObject.createArray().cast();
    for (Object item : value)
        result.push(asJSO(item));//  w ww  .  ja  v a  2s  .c  o  m
    return result;
}

From source file:org.gwtnode.modules.mysql.Connection.java

License:Apache License

@GwtNodeFunction
public final Query query(String sql, List<RowDataPacket> values, QueryResultCallback callback) {
    JsArray<JavaScriptObject> jsaValues = null;
    if (values != null) {
        jsaValues = JavaScriptObject.createArray().cast();
        for (RowDataPacket value : values)
            jsaValues.push(value.getJavaScriptObject());
    }/*from w  w  w.j  a v  a2 s .co m*/
    return query(sql, jsaValues, callback);
}

From source file:org.gwtnode.modules.mysql.Connection.java

License:Apache License

@GwtNodeFunction
public final Query query(String sql, Object[] values, QueryResultCallback callback) {
    JsArray<JavaScriptObject> jsaValues = null;
    if (values != null) {
        jsaValues = JavaScriptObject.createArray().cast();
        for (Object value : values)
            jsaValues.push(asJSO(value));
    }/*w w  w. j a  v  a  2s. co m*/
    return query(sql, jsaValues, callback != null ? callback.getNativeFunction() : null);
}

From source file:org.jboss.hal.js.JsonArray.java

License:Apache License

public static JsonArray create() {
    return (JsonArray) JavaScriptObject.createArray();
}

From source file:org.kjots.json.object.gwt.client.impl.GwtJsonObjectFactoryImplBase.java

License:Apache License

/**
 * Create a new JSON array.//from   w w w .j a  v  a2s  .  c  o  m
 *
 * @param <T> The type of the JSON array.
 * @param jsonArrayClass The class of the JSON array.
 * @return The JSON array.
 */
@Override
public final <T extends JsonArray> T createJsonArray(Class<T> jsonArrayClass) {
    return this.getJsonObjectInstantiator(jsonArrayClass).newInstance(JavaScriptObject.createArray());
}

From source file:org.kjots.json.object.gwt.client.impl.GwtJsonObjectFactoryImplBase.java

License:Apache License

/**
 * Create a new JSON array./*from  ww w. j a  v a2  s  .c  o m*/
 *
 * @param <T> The type of the JSON array.
 * @param jsonArrayClassName The name of the class of the JSON array.
 * @return The JSON array.
 */
@Override
public final <T extends JsonArray> T createJsonArray(String jsonArrayClassName) {
    return this.<T>getJsonObjectInstantiator(jsonArrayClassName).newInstance(JavaScriptObject.createArray());
}