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

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

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

Scheduler.scheduleEntry介绍

[英]An "entry" command will be executed before GWT-generated code is invoked by the browser's event loop. The RepeatingCommand will be called once per entry from the event loop until false is returned. This type of command is appropriate for instrumentation or code that needs to know when "something happens."

If an entry command schedules another entry command, the second command will be executed before control flow continues to the GWT-generated code.
[中]浏览器的事件循环调用GWT生成的代码之前,将执行一个“entry”命令。RepeatingCommand将从事件循环中的每个条目调用一次,直到返回false。这种类型的命令适用于需要知道何时“发生了什么”的指令插入或代码
如果一个entry命令调度另一个entry命令,那么在控制流继续执行GWT生成的代码之前,将执行第二个命令。

代码示例

代码示例来源:origin: com.sksamuel.jqm4gwt/jqm4gwt-standalone

private void validationStyles(Validator validator, String msg, UIObject ui, boolean pass) {
    removeStyles(validator, ui);

    final Label label = validatorLabels.get(validator);
    if (pass) {
      // delay cleaning to allow normal button click processing
      Scheduler.get().scheduleEntry(new ScheduledCommand() {
        @Override
        public void execute() {
          label.setText(null);
          label.setVisible(false);
        }
      });
    } else {
      label.setVisible(true);
      label.setText(msg);
      ui.addStyleName(STYLE_ERROR_TYPE + getShortClassName(validator.getClass()));
    }

    if (ui.getStyleName().contains(STYLE_ERROR_TYPE)) {
      ui.addStyleName(STYLE_ERRORCONTAIN);
    } else {
      ui.addStyleName(STYLE_OK_VALIDATED);
    }
  }
}

代码示例来源:origin: com.sksamuel.jqm4gwt/jqm4gwt-library

private void validationStyles(Validator validator, String msg, UIObject ui, boolean pass) {
    removeStyles(validator, ui);

    final Label label = validatorLabels.get(validator);
    if (pass) {
      // delay cleaning to allow normal button click processing
      Scheduler.get().scheduleEntry(new ScheduledCommand() {
        @Override
        public void execute() {
          label.setText(null);
          label.setVisible(false);
        }
      });
    } else {
      label.setVisible(true);
      label.setText(msg);
      ui.addStyleName(STYLE_ERROR_TYPE + getShortClassName(validator.getClass()));
    }

    if (ui.getStyleName().contains(STYLE_ERROR_TYPE)) {
      ui.addStyleName(STYLE_ERRORCONTAIN);
    } else {
      ui.addStyleName(STYLE_OK_VALIDATED);
    }
  }
}

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

private void validationStyles(Validator validator, String msg, UIObject ui, boolean pass) {
    removeStyles(validator, ui);

    final Label label = validatorLabels.get(validator);
    if (pass) {
      // delay cleaning to allow normal button click processing
      Scheduler.get().scheduleEntry(new ScheduledCommand() {
        @Override
        public void execute() {
          label.setText(null);
          label.setVisible(false);
        }
      });
    } else {
      label.setVisible(true);
      label.setText(msg);
      ui.addStyleName(STYLE_ERROR_TYPE + getShortClassName(validator.getClass()));
    }

    if (ui.getStyleName().contains(STYLE_ERROR_TYPE)) {
      ui.addStyleName(STYLE_ERRORCONTAIN);
    } else {
      ui.addStyleName(STYLE_OK_VALIDATED);
    }
  }
}

代码示例来源:origin: org.jboss.ballroom/widgets

Scheduler.get().scheduleEntry(new Scheduler.ScheduledCommand() {
  public void execute() {
    framework.getEventBus().addHandler(LHSHighlightEvent.TYPE, LHSNavTree.this);

相关文章