Java Code Examples for com.google.gwt.core.client.JsArray#set()

The following examples show how to use com.google.gwt.core.client.JsArray#set() . You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: Util.java    From openchemlib-js with BSD 3-Clause "New" or "Revised" License 5 votes vote down vote up
public static JavaScriptObject convertParameterizedStringList(ParameterizedStringList list) {
  int size = list.getSize();
  JsArray<JavaScriptObject> array = newJsArray(size);
  for (int i = 0; i < size; i++) {
    array.set(i, getParameterizedString(list.getStringAt(i), list.getStringTypeAt(i)));
  }
  return array;
}
 
Example 2
Source File: Util.java    From openchemlib-js with BSD 3-Clause "New" or "Revised" License 5 votes vote down vote up
public static JavaScriptObject convertParameterizedStringList(ParameterizedStringList list) {
  int size = list.getSize();
  JsArray<JavaScriptObject> array = newJsArray(size);
  for (int i = 0; i < size; i++) {
    array.set(i, getParameterizedString(list.getStringAt(i), list.getStringTypeAt(i)));
  }
  return array;
}
 
Example 3
Source File: FullCalendar.java    From gwtbootstrap3-extras with Apache License 2.0 5 votes vote down vote up
public void addEvents(final List<Event> events) {
    if (loaded && events != null && !events.isEmpty()) {
        JsArray<JavaScriptObject> jsEvents = JavaScriptObject.createArray(events.size()).cast();
        int i = 0;
        for (final Event evt : events) {
            jsEvents.set(i++, evt.toJavaScript());
        }
        addEventSource(getElement().getId(), jsEvents);
    }
}