Example usage for com.google.gwt.core.client JsArrayBoolean set

List of usage examples for com.google.gwt.core.client JsArrayBoolean set

Introduction

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

Prototype

public final native void set(int index, boolean value) ;

Source Link

Document

Sets the value value at a given index.

Usage

From source file:com.googlecode.gwt.charts.client.ajaxloader.ArrayHelper.java

License:Apache License

/**
 * Converts a Java array of booleans to a JavaScript boolean array.
 * //from  w  w  w .  j a  va  2s . c  o  m
 * @param bits array of booleans to convert.
 */
public static JsArrayBoolean toJsArrayBoolean(boolean... bits) {
    JsArrayBoolean result = JsArrayBoolean.createArray().cast();
    for (int i = 0; i < bits.length; i++) {
        result.set(i, bits[i]);
    }
    nativePatchConstructorForSafari(result);
    return result;
}

From source file:org.turbogwt.core.collections.JsArrays.java

License:Apache License

public static JsArrayBoolean fromArray(boolean... values) {
    if (GWT.isScript()) {
        return reinterpretCast(values);
    } else {/*from   w ww .j a v  a  2  s . c o  m*/
        JsArrayBoolean ret = JavaScriptObject.createArray().cast();
        for (int i = 0, l = values.length; i < l; i++) {
            ret.set(i, values[i]);
        }
        return ret;
    }
}

From source file:thothbot.parallax.core.client.gl2.arrays.JsArrayUtil.java

License:Apache License

/**
 * Wraps a Java boolean Array to a JsArrayBoolean.
 * /* www  . j  a  v  a 2 s.  c o m*/
 * @param srcArray
 *            the array to wrap
 * @return the wrapped array
 */
public static JsArrayBoolean wrapArray(boolean[] srcArray) {
    if (GWT.isScript()) {
        return arrayAsJsArrayForProdMode(srcArray);
    }
    JsArrayBoolean result = JavaScriptObject.createArray().cast();
    for (int i = 0; i < srcArray.length; i++) {
        result.set(i, srcArray[i]);
    }
    return result;
}