/** * Provides lazy-init pattern for the task queues. */ private static JsArray<Task> push(JsArray<Task> queue, Task task) { if (queue == null) { queue = createQueue(); } queue.push(task); return queue; }
/** * Take a Java array, and produce a JS array that is only used for reading. As * this is actually a reference to the original array in prod mode, the source * must not be modified while this copy is in use or you will get different * behavior between DevMode and prod mode. * * @param array source array * @return JS array, which may be a copy or an alias of the input array */ public static <T extends JavaScriptObject> JsArray<T> readOnlyJsArray(T[] array) { if (GWT.isScript()) { return arrayAsJsArrayForProdMode(array).cast(); } JsArray<T> dest = JavaScriptObject.createArray().cast(); for (int i = 0; i < array.length; ++i) { dest.push(array[i]); } return dest; }
private void setParameter(final JsArray<JavaScriptObject> params, final IsJavaScriptObject isJS) { if (isJS != null) { params.push(isJS.toJavaScript()); } } }
/** * Provides lazy-init pattern for the task queues. */ private static JsArray<Task> push(JsArray<Task> queue, Task task) { if (queue == null) { queue = createQueue(); } queue.push(task); return queue; }
/** * Provides lazy-init pattern for the task queues. */ private static JsArray<Task> push(JsArray<Task> queue, Task task) { if (queue == null) { queue = createQueue(); } queue.push(task); return queue; }
newTasks.push(tasks.get(i));
/** * Add an annotation to a the local <code>annotations</code> JsArray<AceAnnotation>, but does not set it on the editor * * @param row to which the annotation should be added * @param column to which the annotation applies * @param text to display as a tooltip with the annotation * @param type to be displayed (one of the values in the * {@link AceAnnotationType} enumeration) */ public void addAnnotation(final int row, final int column, final String text, final AceAnnotationType type) { annotations.push(AceAnnotation.create(row, column, text, type.getName())); }
protected int createObject(WebGLObject object, WebGLObjectType type) { // TODO (haustein) keep track of empty positions. // for (int i = 0; i < webGLObjects.size(); i++) { // if (webGLObjects.get(i) == null) { // webGLObjects.set(i, container); // return i; // } // } webGLObjects.push(object); webGLObjectTypes.push(type.ordinal()); return webGLObjects.length() - 1; }
public void execute(final Collection<Suggestion<T>> suggestions) { JsArray<Suggestion<T>> jsArray = JsArrayString.createArray().cast(); if (suggestions != null) { for (Suggestion<T> s : suggestions) { jsArray.push(s); } } invokeCallback(jsCallback, jsArray); }
public void execute(final Collection<Suggestion<T>> suggestions) { JsArray<Suggestion<T>> jsArray = JsArrayString.createArray().cast(); if (suggestions != null) { for (Suggestion<T> s : suggestions) { jsArray.push(s); } } invokeCallback(jsCallback, jsArray); }
@Override public void invokeWithCompletions(AceCompletion[] proposals) { JsArray<JavaScriptObject> jsProposals = JavaScriptObject.createArray().cast(); for (AceCompletion proposal : proposals) { jsProposals.push(proposal.toJsObject()); } doInvokeWithCompletions(jsProposals); }
@Override public void invokeWithCompletions(AceCompletion[] proposals) { JsArray<JavaScriptObject> jsProposals = JavaScriptObject.createArray().cast(); for (AceCompletion proposal : proposals) { jsProposals.push(proposal.toJsObject()); } doInvokeWithCompletions(jsProposals); }
public MarkerClusterGroup addLayers(final List<ILayer> layers) { final JsArray<JSObject> layerArray = JsArray.createArray().cast(); for (final ILayer marker : layers) { layerArray.push(marker.getJSObject()); } MarkerClusterGroupImpl.addLayers(getJSObject(), layerArray); return this; }
protected void configure() { JsArray<JavaScriptObject> datasetJSOs = JsArray.createArray().cast(); for (Dataset<T> dataset : datasets) { JavaScriptObject jso = toJSO(dataset); datasetJSOs.push(jso); } configure(getElement(), highlight, hint, minLength, datasetJSOs); }
protected void configure() { JsArray<JavaScriptObject> datasetJSOs = JsArray.createArray().cast(); for (Dataset<T> dataset : datasets) { JavaScriptObject jso = toJSO(dataset); datasetJSOs.push(jso); } configure(getElement(), highlight, hint, minLength, datasetJSOs); }
@Override public JsArray<Touch> getChangedTouches() { JsArray<Touch> array = SimulatedTouch.createTouchArray(); SimulatedTouch touch = SimulatedTouch.createTouch(); touch.setClientX(clientX); touch.setClientY(clientY); touch.setPageX(pageX); touch.setPageY(pageY); touch.setId(touchId); array.push(touch); return array; }
@Override public JsArray<Touch> getChangedTouches() { JsArray<Touch> array = SimulatedTouch.createTouchArray(); SimulatedTouch touch = SimulatedTouch.createTouch(); touch.setClientX(clientX); touch.setClientY(clientY); touch.setPageX(pageX); touch.setPageY(pageY); touch.setId(touchId); array.push(touch); return array; }
@Override public JsArray<Touch> getChangedTouches() { JsArray<Touch> array = SimulatedTouch.createTouchArray(); SimulatedTouch touch = SimulatedTouch.createTouch(); touch.setClientX(clientX); touch.setClientY(clientY); touch.setPageX(pageX); touch.setPageY(pageY); touch.setId(touchId); array.push(touch); return array; }
@Override public JsArray<Touch> getChangedTouches() { JsArray<Touch> array = SimulatedTouch.createTouchArray(); SimulatedTouch touch = SimulatedTouch.createTouch(); touch.setClientX(clientX); touch.setClientY(clientY); touch.setPageX(pageX); touch.setPageY(pageY); touch.setId(touchId); array.push(touch); return array; }
@Override public void dataAddSerie(String columnName, String color, double[] values) { series.push(SeriesBuilder.create() .withLabel(columnName) .withFillColor(color) .withStoreColor(color) .withPointColor(color) .withPointStrokeColor("#FFFF") .withData(values) .get()); }