/** * Add a stylesheet to the document. * * @param css the CSS contents of the stylesheet * @param immediate if <code>true</code> the DOM will be updated immediately * instead of just before returning to the event loop. Using this * option excessively will decrease performance, especially if used * with an inject-css-on-init coding pattern */ public static void inject(String css, boolean immediate) { toInject.push(css); inject(immediate); }
/** * Add stylesheet data to the document as though it were declared after all * stylesheets previously created by {@link #inject(String)}. * * @param css the CSS contents of the stylesheet * @param immediate if <code>true</code> the DOM will be updated immediately * instead of just before returning to the event loop. Using this * option excessively will decrease performance, especially if used * with an inject-css-on-init coding pattern */ public static void injectAtEnd(String css, boolean immediate) { toInjectAtEnd.push(css); inject(immediate); }
/** * Add a stylesheet to the document. * <p> * The returned StyleElement cannot be implemented consistently across all * browsers. Specifically, <strong>applications that need to run on Internet * Explorer should not use this method. Call {@link #inject(String)} * instead.</strong> * * @param contents the CSS contents of the stylesheet * @return the StyleElement that contains the newly-injected CSS (unreliable * on Internet Explorer) */ public static StyleElement injectStylesheet(String contents) { toInject.push(contents); return flush(toInject); }
/** * Add stylesheet data to the document as though it were declared after all * stylesheets previously created by {@link #injectStylesheet(String)}. * <p> * The returned StyleElement cannot be implemented consistently across all * browsers. Specifically, <strong>applications that need to run on Internet * Explorer should not use this method. Call {@link #injectAtEnd(String)} * instead.</strong> * * @param contents the CSS contents of the stylesheet * @return the StyleElement that contains the newly-injected CSS (unreliable * on Internet Explorer) */ public static StyleElement injectStylesheetAtEnd(String contents) { toInjectAtEnd.push(contents); return flush(toInjectAtEnd); }
public static JsArrayString toJsArray(String[] input) { JsArrayString jsArrayString = JsArrayString.createArray().cast(); for (String s : input) { jsArrayString.push(s); } return jsArrayString; }
String[] jStrings = {"one", "two", "three"}; JsArrayString jsStrings = (JsArrayString)JsArrayString.createArray(); for (String s : jStrings) { jsStrings.push(s); } test(jsStrings);
public static JsArrayString toJsArray(String[] input) { JsArrayString jsArrayString = JsArrayString.createArray().cast(); for (String s : input) { jsArrayString.push(s); } return jsArrayString; }
private static JsArrayString createJsArrayString(List<String> list) { JsArrayString jsArray = (JsArrayString) JsArrayString.createArray(); for (String string : list) { jsArray.push(string); } return jsArray; }
public static JsArrayString getJsArrayString(String... strings) { JsArrayString jsStrs = (JsArrayString) JavaScriptObject.createArray(); for (String s : strings) { jsStrs.push(s); } return jsStrs; }
public static JsArrayString toJsArray(String[] input) { JsArrayString jsArrayString = createEmptyJsArrayString(); for (String s : input) { jsArrayString.push(s); } return jsArrayString; } private static native JsArrayString createEmptyJsArrayString() /*-{ return []; }-*/;
public static JsArrayString getJsArrayString(String... strings) { JsArrayString jsStrs = (JsArrayString) JavaScriptObject.createArray(); for (String s : strings) { jsStrs.push(s); } return jsStrs; }
public static JsArrayString getJsArrayString(String... strings) { JsArrayString jsStrs = (JsArrayString) JavaScriptObject.createArray(); for (String s : strings) { jsStrs.push(s); } return jsStrs; }
public void push(String value) { if(GWT.isScript()) { stackNative.push(value); } else { stackJava.add(value); } }
/** * Add a stylesheet to the document. * * @param css the CSS contents of the stylesheet * @param immediate if <code>true</code> the DOM will be updated immediately * instead of just before returning to the event loop. Using this * option excessively will decrease performance, especially if used * with an inject-css-on-init coding pattern */ public static void inject(String css, boolean immediate) { toInject.push(css); inject(immediate); }
public static JsArrayString readOnlyJsArray(String[] array) { if (GWT.isScript()) { return arrayAsJsArrayForProdMode(array).cast(); } JsArrayString dest = JsArrayString.createArray().cast(); for (int i = 0; i < array.length; ++i) { dest.push(array[i]); } return dest; } private static native JavaScriptObject arrayAsJsArrayForProdMode(Object array) /*-{ return array; }-*/;
protected JsArrayString extractOptions(ToolbarButton[] options) { JsArrayString jsOptions = JsArrayString.createArray().cast(); for (ToolbarButton option : options) { jsOptions.push(option.getId()); } return jsOptions; } }
/** * Sets IDs of map types to show in the control. * * @param typeIds IDs of map types to show in the control */ public void setMapTypeIds(final MapTypeId[] typeIds) { final JsArrayString ids = JsArrayString.createArray().cast(); for (final MapTypeId id : typeIds) { ids.push(id.name()); } setMapTypeIdsJs(ids); }
public void setCategories(final String[] categories) { final JsArrayString array = JsArrayString.createArray().cast(); for (final String category : categories) { array.push(category); } final JSObject jsObject = array.cast(); getJSObject().setProperty(Property.CATEGORIES, jsObject); }
private void callback(final JavaScriptObject process, Response response) { suggestions = response.getSuggestions(); JsArrayString jsArrayString = JavaScriptObject.createArray().cast(); for (Suggestion suggestion : suggestions) { jsArrayString.push(suggestion.getDisplayString()); } callProcess(jsArrayString, process); }
public void setCategories(final String[] categories) { final JsArrayString array = JsArrayString.createArray().cast(); for (final String category : categories) { array.push(category); } final JSObject jsObject = array.cast(); getJSObject().setProperty(Property.CATEGORIES, jsObject); }