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:java.util.BitSet.java

License:Apache License

public BitSet() {
    // create a new array
    array = JavaScriptObject.createArray().cast();
}

From source file:java.util.BitSet.java

License:Apache License

public void clear() {
    // create a new array
    array = JavaScriptObject.createArray().cast();
}

From source file:kellegous.client.data.Array.java

License:Apache License

public static <T> Array<T> create() {
    return JavaScriptObject.createArray().cast();
}

From source file:kellegous.client.data.IntArray.java

License:Apache License

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

From source file:kellegous.client.data.StringArray.java

License:Apache License

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

From source file:net.blimster.gwt.threejsx.util.Arrays.java

License:Open Source License

public static <T extends JavaScriptObject> JsArray<T> createArray(T... elements) {
    JsArray<T> result = JavaScriptObject.createArray().cast();

    for (T element : elements) {
        result.push(element);// w  ww.  j  a  v  a 2s .co m
    }

    return result;
}

From source file:nl.strohalm.cyclos.mobile.client.utils.JsonHelper.java

License:Open Source License

public static <T extends JavaScriptObject> JsArray<T> createGenericArray(List<T> objects) {
    JsArray<T> array = JavaScriptObject.createArray().cast();
    for (T object : objects) {
        array.push(object);/*ww w  .  java2s .  co  m*/
    }
    return array;
}

From source file:org.cruxframework.crux.plugin.gadget.client.features.ListPreference.java

License:Apache License

/**
 * Set a preference with a list of strings.
 * //from   w w  w . jav a2 s .  c  o  m
 * @param value the list of strings to set.
 */
@Override
void set(String[] value) {
    JavaScriptObject array = JavaScriptObject.createArray();
    for (String s : value) {
        prefs.push(array, s);
    }
    prefs.setArray(getName(), array);
}

From source file:org.cruxframework.crux.plugin.gadget.client.features.osapi.albums.GetAlbumsRequestBuilder.java

License:Apache License

/**
 * Sets a list of IDs specifying the {@link Album}s to retrieve.
 *
 * @param ids A list of IDs.// w w w  . ja  va 2 s . c o  m
 */
public final GetAlbumsRequestBuilder setIds(String... ids) {
    JsArrayString array = JavaScriptObject.createArray().cast();
    for (String id : ids) {
        array.push(id);
    }
    return nativeSet("id", array);
}

From source file:org.cruxframework.crux.plugin.gadget.client.features.osapi.mediaitems.GetMediaItemsRequestBuilder.java

License:Apache License

/**
 * Sets a list of MediaItem IDs specifying the MediaItems to retrieve.
 *
 * @param ids IDs specifying the MediaItems to retrieve.
 *///from   www .j  a  v  a2s .  com
public final GetMediaItemsRequestBuilder setIds(String... ids) {
    JsArrayString array = JavaScriptObject.createArray().cast();
    for (String id : ids) {
        array.push(id);
    }
    return nativeSet("id", array);
}