Refine search
@Override public void resetFocus(ScheduledCommand command) { // Some browsers will not focus an element that was created in this event loop. Scheduler.get().scheduleDeferred(command); } }
private void onFrameLoadImpl() { // Fire onComplete events in a deferred command. This is necessary // because clients that detach the form panel when submission is // complete can cause some browsers (i.e. Mozilla) to go into an // 'infinite loading' state. See issue 916. Scheduler.get().scheduleDeferred(new ScheduledCommand() { public void execute() { fireEvent(new SubmitCompleteEvent(impl.getContents(synthesizedFrame))); } }); }
@Override public void resetFocus(ScheduledCommand command) { // IE will not focus an element that was created in this event loop. Scheduler.get().scheduleDeferred(command); }
private static void runAsyncImpl(final RunAsyncCallback callback) { Scheduler.get().scheduleDeferred(new ScheduledCommand() { @Override public void execute() { callback.onSuccess(); } }); }
/** * Executes onSuccess asynchronously. */ void execute(final AsyncFragmentLoader fragmentLoader, final RunAsyncCallback callback) { Scheduler.get().scheduleDeferred(new ScheduledCommand() { @Override public void execute() { fragmentLoader.executeOnSuccess0(callback); } }); } }
private void preventDatePickerPopup() { allowDPShow = false; Scheduler.get().scheduleDeferred(new ScheduledCommand() { public void execute() { allowDPShow = true; } }); }
/** * Cleans everything once the response has been received: deletes the script * tag and unregisters the callback. */ private void unload() { /* * Some browsers (IE7) require the script tag to be deleted outside the * scope of the script itself. Therefore, we need to defer the delete * statement after the callback execution. */ Scheduler.get().scheduleDeferred(new ScheduledCommand() { public void execute() { if (!canHaveMultipleRequestsForSameId) { // If there can me multiple requests for a particular ID, then we // don't want to unregister the callback since there may be pending // requests that have not yet come back and we don't want them to // have an undefined callback function. unregisterCallbacks(CALLBACKS, callbackId); } Node script = Document.get().getElementById(callbackId); if (script != null) { // The script may have already been deleted getHeadElement().removeChild(script); } } }); }
/** * Schedule layout to adjust the height of the content area. */ private void scheduledLayout() { if (isAttached() && !layoutScheduled) { layoutScheduled = true; Scheduler.get().scheduleDeferred(layoutCmd); } } }
/** * Schedule a resize handler. We schedule the event so the DOM has time to * update the offset sizes, and to avoid duplicate resize events from both a * height and width resize. */ private void scheduleResize() { if (isAttached() && !resizeCmdScheduled) { resizeCmdScheduled = true; Scheduler.get().scheduleDeferred(resizeCmd); } } }
@Override protected void onLoad() { hideNativeScrollbars(); Scheduler.get().scheduleDeferred(new ScheduledCommand() { @Override public void execute() { maybeUpdateScrollbars(); } }); }
Scheduler.get().scheduleDeferred(syntheticEventCommand);
@Override protected void onLoad() { impl.onAttach(); /* * Set the position realizing it might not work until after layout runs. * This first call is simply to try to avoid a jitter effect if possible. */ setSplitPosition(lastSplitPosition); Scheduler.get().scheduleDeferred(new ScheduledCommand() { public void execute() { setSplitPosition(lastSplitPosition); } }); }
@Override protected void onLoad() { impl.onAttach(); /* * If the split position has been changed while detached, apply the change. * Set the position realizing that it might not work until after layout * runs. This first call is simply to try to avoid a jitter effect if * possible. */ setSplitPosition(lastSplitPosition); Scheduler.get().scheduleDeferred(new ScheduledCommand() { public void execute() { setSplitPosition(lastSplitPosition); } }); }
@Override public void onAttach() { super.onAttach(); DOM.setEventListener(expandable, this); DOM.setEventListener(collapsible, this); /* * Update the scrollables in a deferred command so the browser calculates * the offsetHeight/Width correctly. */ Scheduler.get().scheduleDeferred(new ScheduledCommand() { public void execute() { resetScrollables(); } }); }
Scheduler.get().scheduleDeferred(layoutCommand);
Scheduler.get().scheduleDeferred(new ScheduledCommand() { public void execute() { outerElem.getStyle().setOverflow(Overflow.AUTO);
@Override public void onBrowserEvent(final Widget widget, Event event) { // We need to remove the event listener from the cell now that the event // has fired. String type = event.getType().toLowerCase(Locale.ROOT); if (BrowserEvents.FOCUS.equals(type) || BrowserEvents.BLUR.equals(type) || BrowserEvents.CHANGE.equals(type)) { EventTarget eventTarget = event.getEventTarget(); if (Element.is(eventTarget)) { Element target = eventTarget.cast(); if (target != widget.getElement()) { DOM.setEventListener(target, null); } } } // Update the value of the focused input box. if (focusedInput != null && BrowserEvents.CHANGE.equals(type)) { focusedInputValue = getInputValue(focusedInput); } // We might need to fire a synthetic change event on the input element. if (focusedInput != null && !focusedInputChangesOnBlurOnly && changeEventTriggers.contains(type)) { // Defer the change event because the change does not occur until after // the events specified above. Scheduler.get().scheduleDeferred(new ScheduledCommand() { public void execute() { maybeFireChangeEvent(widget); } }); } }
@Override public void setCaption( final FieldSetElement fieldset, Element legend, @IsSafeHtml String caption, boolean asHTML) { fieldset.getStyle().setProperty("visibility", "hidden"); super.setCaption(fieldset, legend, caption, asHTML); Scheduler.get().scheduleDeferred(new ScheduledCommand() { public void execute() { fieldset.getStyle().setProperty("visibility", ""); } }); } }
public static void addListener(final DomEventCallback callback, final boolean defer) { Scheduler.get().scheduleDeferred(new Command() { @Override public void execute() { addListener(callback); } }); }
private void onFrameLoadImpl() { // Fire onComplete events in a deferred command. This is necessary // because clients that detach the form panel when submission is // complete can cause some browsers (i.e. Mozilla) to go into an // 'infinite loading' state. See issue 916. Scheduler.get().scheduleDeferred(new ScheduledCommand() { @Override public void execute() { fireEvent(new SubmitCompleteEvent(impl.getContents(synthesizedFrame))); } }); }