public final void set(String key, String[] array) { JsArrayString jsArray = createStringArray(); jsArray.setLength(array.length); for(int i = 0; i < array.length; i++) { jsArray.set(i, array[i]); } set(key, jsArray); }
public void set(int index, String value) { if(GWT.isScript()) { stackNative.set(index, value); } else { stackJava.set(index, value); } }
/** * Converts a java String array into a javascript array (JsArray). * * @param array the array containing values * @return a corresponding JsArrayString */ public static JsArrayString createArray(String... array) { JsArrayString jsArray = JavaScriptObject.createArray().cast(); for (int i = 0; i < array.length; i++) { jsArray.set(i, array[i]); } return jsArray; }
array.set(i, list.get(i));
public final void importScripts(String[] urls) { JsArrayString jsUrls = JsArrayString.createArray().cast(); for (int i = 0, l = urls.length; i < l; ++i) { jsUrls.set(i, urls[i]); } importScripts(jsUrls); }
/** * set user defined string ID of map types to show in the control. * * @param mapTypeIds */ public final void setMapTypeIds(String[] mapTypeIds) { JsArrayString result = JsArrayString.createArray().cast(); for (int i = 0; i < mapTypeIds.length; i++) { result.set(i, mapTypeIds[i]); } setMapTypeIdsStringJs(result); }
@Override public void afterDraw(Element tableElt, JavaScriptObject settings) { if (!Empty.is(serverRowDetails)) { JsArrayString rowIds = JavaScriptObject.createArray(serverRowDetails.size()).cast(); int i = 0; for (String s : serverRowDetails) { rowIds.set(i, s); i++; } JsDataTable.openRowDetails(tableElt, rowIds); } }
public final void importScripts(String[] urls) { JsArrayString jsUrls = JsArrayString.createArray().cast(); for (int i = 0, l = urls.length; i < l; ++i) { jsUrls.set(i, urls[i]); } importScripts(jsUrls); }
/** * set user defined string ID of map types to show in the control. * * @param mapTypeIds */ public final void setMapTypeIds(String[] mapTypeIds) { JsArrayString result = JsArrayString.createArray().cast(); for (int i = 0; i < mapTypeIds.length; i++) { result.set(i, mapTypeIds[i]); } setMapTypeIdsStringJs(result); }
@Override public void afterDraw(Element tableElt, JavaScriptObject settings) { if (!Empty.is(serverRowDetails)) { JsArrayString rowIds = JavaScriptObject.createArray(serverRowDetails.size()).cast(); int i = 0; for (String s : serverRowDetails) { rowIds.set(i, s); i++; } JsDataTable.openRowDetails(tableElt, rowIds); } }
/** * Converts an array of Java strings to an array of JavaScript strings. * * @param strings array of strings to convert */ public static JsArrayString toJsArrayString(String... strings) { JsArrayString result = JsArrayString.createArray().cast(); for (int i = 0; i < strings.length; i++) { result.set(i, strings[i]); } nativePatchConstructorForSafari(result); return result; }
public static JsArrayString fromArray(String... values) { if (GWT.isScript()) { return reinterpretCast(values); } else { JsArrayString ret = JavaScriptObject.createArray().cast(); for (int i = 0, l = values.length; i < l; i++) { ret.set(i, values[i]); } return ret; } }
/** * set IDs of map types to show in the control. * * @param mapTypeIds */ public final void setMapTypeIds(MapTypeId[] mapTypeIds) { JsArrayString result = JsArrayString.createArray().cast(); for (int i = 0; i < mapTypeIds.length; i++) { result.set(i, mapTypeIds[i].value()); } // TODO cannot access private method. Perhaps API was updated? // ArrayHelper.nativePatchConstructorForSafari(result); setMapTypeIdsJs(result); }
/** * set IDs of map types to show in the control. * * @param mapTypeIds */ public final void setMapTypeIds(MapTypeId[] mapTypeIds) { JsArrayString result = JsArrayString.createArray().cast(); for (int i = 0; i < mapTypeIds.length; i++) { result.set(i, mapTypeIds[i].value()); } // TODO cannot access private method. Perhaps API was updated? // ArrayHelper.nativePatchConstructorForSafari(result); setMapTypeIdsJs(result); }
/** * Set the background color inside the grid area as a gradient. */ public final GridOptions setBackgroundColor( String fromColor, String toColor ) { JsArrayString array = getBackgroundColorAsArray(); if ( null == array ) { JsonObject jsonObject = JavaScriptObject.createObject().cast(); array = JavaScriptObject.createArray().cast(); jsonObject.put( BACKGROUND_COLORS_KEY, array ); put( BACKGROUND_COLOR_KEY, jsonObject ); } array.set( 0, fromColor ); array.set( 1, toColor ); return this; }
OptionElement oe = se.getOptions().getItem(i); if (oe.isSelected()) { result.set(result.length(), oe.getValue());
for (Entry<String, String> i : keyVal.entrySet()) { values.set(j, Integer.parseInt(i.getKey())); names.set(j, i.getValue() != null ? i.getValue() : i.getKey()); j++;
for (Entry<String, String> i : keyVal.entrySet()) { values.set(j, Integer.parseInt(i.getKey())); names.set(j, i.getValue() != null ? i.getValue() : i.getKey()); j++;