com.google.gwt.core.client.Scheduler.get()方法的使用及代码示例

x33g5p2x  于2022-01-29 转载在 其他  
字(7.0k)|赞(0)|评价(0)|浏览(101)

本文整理了Java中com.google.gwt.core.client.Scheduler.get()方法的一些代码示例,展示了Scheduler.get()的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Scheduler.get()方法的具体详情如下:
包路径:com.google.gwt.core.client.Scheduler
类名称:Scheduler
方法名:get

Scheduler.get介绍

[英]Returns the default implementation of the Scheduler API.
[中]返回调度程序API的默认实现。

代码示例

代码示例来源:origin: com.google.gwt/gwt-servlet

@Override
 public void resetFocus(ScheduledCommand command) {
  // Some browsers will not focus an element that was created in this event loop.
  Scheduler.get().scheduleDeferred(command);
 }
}

代码示例来源:origin: com.google.gwt/gwt-servlet

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)));
  }
 });
}

代码示例来源:origin: com.google.gwt/gwt-servlet

@Override
public void resetFocus(ScheduledCommand command) {
 // IE will not focus an element that was created in this event loop.
 Scheduler.get().scheduleDeferred(command);
}

代码示例来源:origin: com.google.gwt/gwt-servlet

private static void runAsyncImpl(final RunAsyncCallback callback) {
 Scheduler.get().scheduleDeferred(new ScheduledCommand() {
  @Override public void execute() {
   callback.onSuccess();
  }
 });
}

代码示例来源:origin: com.google.gwt/gwt-servlet

/**
  * Executes onSuccess asynchronously.
  */
 void execute(final AsyncFragmentLoader fragmentLoader, final RunAsyncCallback callback) {
  Scheduler.get().scheduleDeferred(new ScheduledCommand() {
   @Override
   public void execute() {
    fragmentLoader.executeOnSuccess0(callback);
   }
  });
 }
}

代码示例来源:origin: com.google.gwt/gwt-servlet

private void preventDatePickerPopup() {
 allowDPShow = false;
 Scheduler.get().scheduleDeferred(new ScheduledCommand() {
  public void execute() {
   allowDPShow = true;
  }
 });
}

代码示例来源:origin: com.google.gwt/gwt-servlet

/**
 * 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);
   }
  }
 });
}

代码示例来源:origin: com.google.gwt/gwt-servlet

/**
  * Schedule layout to adjust the height of the content area.
  */
 private void scheduledLayout() {
  if (isAttached() && !layoutScheduled) {
   layoutScheduled = true;
   Scheduler.get().scheduleDeferred(layoutCmd);
  }
 }
}

代码示例来源:origin: com.google.gwt/gwt-servlet

/**
  * 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);
  }
 }
}

代码示例来源:origin: com.google.gwt/gwt-servlet

@Override
protected void onLoad() {
 hideNativeScrollbars();
 Scheduler.get().scheduleDeferred(new ScheduledCommand() {
  @Override
  public void execute() {
   maybeUpdateScrollbars();
  }
 });
}

代码示例来源:origin: com.google.gwt/gwt-servlet

Scheduler.get().scheduleDeferred(syntheticEventCommand);

代码示例来源:origin: com.google.gwt/gwt-servlet

@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);
  }
 });
}

代码示例来源:origin: com.google.gwt/gwt-servlet

@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);
  }
 });
}

代码示例来源:origin: com.google.gwt/gwt-servlet

@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();
  }
 });
}

代码示例来源:origin: com.google.gwt/gwt-servlet

Scheduler.get().scheduleDeferred(layoutCommand);

代码示例来源:origin: com.google.gwt/gwt-servlet

Scheduler.get().scheduleDeferred(new ScheduledCommand() {
 public void execute() {
  outerElem.getStyle().setOverflow(Overflow.AUTO);

代码示例来源:origin: com.google.gwt/gwt-servlet

@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);
   }
  });
 }
}

代码示例来源:origin: com.google.gwt/gwt-servlet

@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", "");
   }
  });
 }
}

代码示例来源:origin: OpenNMS/opennms

public static void addListener(final DomEventCallback callback, final boolean defer) {
  Scheduler.get().scheduleDeferred(new Command() {
    @Override public void execute() {
      addListener(callback);
    }
  });
}

代码示例来源:origin: gwtbootstrap3/gwtbootstrap3

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)));
    }
  });
}

相关文章