Example usage for com.google.gwt.core.client JsArrayString push

List of usage examples for com.google.gwt.core.client JsArrayString push

Introduction

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

Prototype

public final native void push(String value) ;

Source Link

Document

Pushes the given value onto the end of the array.

Usage

From source file:tigase.jaxmpp.gwt.client.connectors.WebSocket.java

License:Open Source License

public WebSocket(String url, String[] protocols, WebSocketCallback callback) {
    this.callback = callback;
    JsArrayString jsProtocols = (JsArrayString) JsArrayString.createArray();
    if (protocols != null) {
        for (String protocol : protocols) {
            jsProtocols.push(protocol);
        }/* w w w  .  j a va  2s  .co  m*/
    }
    this.jsWebSocket = createJSWebSocket(url, jsProtocols, this);
}

From source file:uk.ac.ncl.openlab.intake24.client.survey.prompts.AutomaticAssociatedFoodsPrompt.java

License:Apache License

private final JsArrayString listToJsArray(List<String> l) {
    JsArrayString jsArray = (JsArrayString) JsArrayString.createArray();
    for (String str : l) {
        jsArray.push(str);
    }//www. j  a  v  a  2s. co m
    return jsArray;
}

From source file:virtuozo.infra.MessageFormat.java

License:Apache License

public static String format(String pattern, Object... args) {
    if (null == args || 0 == args.length) {
        return pattern;
    }/*from   w w w  .  java  2 s.c  o  m*/

    JsArrayString array = JavaScriptObject.createArray().cast();
    for (Object arg : args) {
        array.push(arg.toString());
    }

    return nativeFormat(pattern, array);
}