当前位置: 首页>>代码示例>>Java>>正文


Java Scheduler类代码示例

本文整理汇总了Java中org.waveprotocol.wave.client.scheduler.Scheduler的典型用法代码示例。如果您正苦于以下问题:Java Scheduler类的具体用法?Java Scheduler怎么用?Java Scheduler使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。


Scheduler类属于org.waveprotocol.wave.client.scheduler包,在下文中一共展示了Scheduler类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: cleanUp

import org.waveprotocol.wave.client.scheduler.Scheduler; //导入依赖的package包/类
private void cleanUp() {
  RootPanel.get().remove(doubleLoadedImage);

  final HandlerRegistration onLoadReg = onLoadHandlerRegistration;
  final HandlerRegistration onErrorReg = onErrorHandlerRegistration;

  // HACK(user): There is a bug in GWT which stops us from removing a listener in HOSTED
  // mode inside the invoke context.  Put the remove in a deferred command to avoid this
  // error
  ScheduleCommand.addCommand(new Scheduler.Task() {
    
    @Override
    public void execute() {
      onLoadReg.removeHandler();
      onErrorReg.removeHandler();
    }
  });

  onLoadHandlerRegistration = null;
  onErrorHandlerRegistration = null;

  completed = true;
}
 
开发者ID:jorkey,项目名称:Wiab.pro,代码行数:24,代码来源:ImageThumbnailWidget.java

示例2: loadStageTwo

import org.waveprotocol.wave.client.scheduler.Scheduler; //导入依赖的package包/类
private void loadStageTwo(final StageOne one) {
  final Timer timer = Timing.start("Stage Two");
  SchedulerInstance.getHighPriorityTimer().schedule(new Scheduler.Task() {

    @Override
    public void execute() {
      createStageTwoLoader(one).call(new Accessor<StageTwo>() {
        @Override
        public void use(StageTwo x) {
          Timing.stop(timer);
          if (x != null) {
            loadStageThree(x);
          } else {
            finish();
          }
        }
      });
    }
  });
}
 
开发者ID:jorkey,项目名称:Wiab.pro,代码行数:21,代码来源:Stages.java

示例3: loadStageThree

import org.waveprotocol.wave.client.scheduler.Scheduler; //导入依赖的package包/类
private void loadStageThree(final StageTwo two) {
  final Timer timer = Timing.start("Stage Tree");
  SchedulerInstance.getHighPriorityTimer().schedule(new Scheduler.Task() {

    @Override
    public void execute() {
      createStageThreeLoader(two).call(new Accessor<StageThree>() {
        @Override
        public void use(StageThree x) {
          Timing.stop(timer);
          finish();
        }
      });
    }
  });
}
 
开发者ID:jorkey,项目名称:Wiab.pro,代码行数:17,代码来源:Stages.java

示例4: scheduleUpdateNotification

import org.waveprotocol.wave.client.scheduler.Scheduler; //导入依赖的package包/类
/**
 * Schedule the editor's update notification
 */
void scheduleUpdateNotification(
    boolean selectionCoordsChanged,
    boolean selectionLocationChanged,
    boolean contentChanged,
    boolean userDirectlyChangedContent) {
  // Internal editor throttling
  // We want special behaviour, here where we do not reset the delay every
  // time this method is called by rescheduling - so we first check if the
  // notification task is scheduled.
  notedSelectionCoordsChanged |= selectionCoordsChanged;
  notedSelectionLocationChanged |= selectionLocationChanged;
  notedContentChanged |= contentChanged;
  notedUserDirectlyChangedContent |= userDirectlyChangedContent;

  Scheduler scheduler = SchedulerInstance.get();
  if (!scheduler.isScheduled(notificationTask)) {
    int delay = (contentChanged || userDirectlyChangedContent) ? 0 : INITIAL_NOTIFY_SCHEDULE_DELAY_MS;
    scheduler.scheduleRepeating(Priority.MEDIUM, notificationTask, delay, NOTIFY_SCHEDULE_DELAY_GAP_MS);
  } else {
    notifyAgain = true;
  }
}
 
开发者ID:jorkey,项目名称:Wiab.pro,代码行数:26,代码来源:EditorUpdateEventImpl.java

示例5: TypingExtractor

import org.waveprotocol.wave.client.scheduler.Scheduler; //导入依赖的package包/类
TypingExtractor(TypingSink sink, NodeManager manager, TimerService service,
    HtmlView filteredHtmlView, ContentView renderedContentView, Repairer repairer,
    SelectionSource selectionSource) {
  this.sink = sink;
  this.manager = manager;
  this.selectionSource = selectionSource;
  this.timerService = service;
  this.filteredHtmlView = filteredHtmlView;
  this.renderedContentView = renderedContentView;
  this.repairer = repairer;
  this.flushCmd = new  Scheduler.Task() {
    @Override
    public void execute() {
      flush();
    }
  };
}
 
开发者ID:jorkey,项目名称:Wiab.pro,代码行数:18,代码来源:TypingExtractor.java

示例6: setPopupPositionAndMakeVisible

import org.waveprotocol.wave.client.scheduler.Scheduler; //导入依赖的package包/类
/**
 * {@inheritDoc}
 */
@Override
public void setPopupPositionAndMakeVisible(final Element relative, final Element p) {
  ScheduleCommand.addCommand(new Scheduler.Task() {
    @Override
    public void execute() {
      p.getStyle().setLeft(relative.getAbsoluteLeft() + (relative.getOffsetWidth() - p.getOffsetWidth()) / 2, Unit.PX);
      int height = PositionUtil.boundHeightToScreen(p.getOffsetHeight());
      int top = relative.getAbsoluteTop() + (relative.getOffsetHeight() - height) / 2;
      // Prevent negative top position.
      p.getStyle().setTop(Math.max(top, MIN_OFFSET_HEIGHT_DEFAULT), Unit.PX);
      p.getStyle().setHeight(height, Unit.PX);
      p.getStyle().setVisibility(Visibility.VISIBLE);
    }
  });
}
 
开发者ID:jorkey,项目名称:Wiab.pro,代码行数:19,代码来源:CenterPopupPositioner.java

示例7: cleanUp

import org.waveprotocol.wave.client.scheduler.Scheduler; //导入依赖的package包/类
private void cleanUp() {
  RootPanel.get().remove(doubleLoadedImage);

  final HandlerRegistration onLoadReg = onLoadHandlerRegistration;
  final HandlerRegistration onErrorReg = onErrorHandlerRegistration;

  // HACK(user): There is a bug in GWT which stops us from removing a listener in HOSTED
  // mode inside the invoke context.  Put the remove in a deferred command to avoid this
  // error
  ScheduleCommand.addCommand(new Scheduler.Task() {
    public void execute() {
      onLoadReg.removeHandler();
      onErrorReg.removeHandler();
    }
  });

  onLoadHandlerRegistration = null;
  onErrorHandlerRegistration = null;

  completed = true;
}
 
开发者ID:apache,项目名称:incubator-wave,代码行数:22,代码来源:ImageThumbnailWidget.java

示例8: loadStageTwo

import org.waveprotocol.wave.client.scheduler.Scheduler; //导入依赖的package包/类
private void loadStageTwo(final StageOne one) {
  final Timer timer = Timing.start("Stage Two");
  SchedulerInstance.getHighPriorityTimer().schedule(new Scheduler.Task() {

    @Override
    public void execute() {
      createStageTwoLoader(one).call(new Accessor<StageTwo>() {
        @Override
        public void use(StageTwo x) {
          Timing.stop(timer);
          loadStageThree(x);
        }
      });
    }
  });
}
 
开发者ID:apache,项目名称:incubator-wave,代码行数:17,代码来源:Stages.java

示例9: scheduleUpdateNotification

import org.waveprotocol.wave.client.scheduler.Scheduler; //导入依赖的package包/类
/**
 * Schedule the editor's update notification
 */
void scheduleUpdateNotification(
    boolean selectionCoordsChanged,
    boolean selectionLocationChanged,
    boolean contentChanged,
    boolean userDirectlyChangedContent) {
  // Internal editor throttling
  // We want special behaviour, here where we do not reset the delay every
  // time this method is called by rescheduling - so we first check if the
  // notification task is scheduled.
  notedSelectionCoordsChanged |= selectionCoordsChanged;
  notedSelectionLocationChanged |= selectionLocationChanged;
  notedContentChanged |= contentChanged;
  notedUserDirectlyChangedContent |= userDirectlyChangedContent;

  Scheduler scheduler = SchedulerInstance.get();
  if (!scheduler.isScheduled(notificationTask)) {
    scheduler.scheduleRepeating(Priority.MEDIUM, notificationTask,
        INITIAL_NOTIFY_SCHEDULE_DELAY_MS, NOTIFY_SCHEDULE_DELAY_GAP_MS);
  } else {
    notifyAgain = true;
  }
}
 
开发者ID:apache,项目名称:incubator-wave,代码行数:26,代码来源:EditorUpdateEventImpl.java

示例10: setPopupPositionAndMakeVisible

import org.waveprotocol.wave.client.scheduler.Scheduler; //导入依赖的package包/类
/**
 * {@inheritDoc}
 */
@Override
public void setPopupPositionAndMakeVisible(Element relative, final Element p) {
  ScheduleCommand.addCommand(new Scheduler.Task() {
    @Override
    public void execute() {
      p.getStyle().setLeft((RootPanel.get().getOffsetWidth() - p.getOffsetWidth()) / 2, Unit.PX);
      int height = PositionUtil.boundHeightToScreen(p.getOffsetHeight());
      int top = (RootPanel.get().getOffsetHeight() - height) / 2;
      // Prevent negative top position.
      p.getStyle().setTop(Math.max(top, MIN_OFFSET_HEIGHT_DEFAULT), Unit.PX);
      p.getStyle().setHeight(height, Unit.PX);
      p.getStyle().setVisibility(Visibility.VISIBLE);
    }
  });
}
 
开发者ID:apache,项目名称:incubator-wave,代码行数:19,代码来源:CenterPopupPositioner.java

示例11: addItem

import org.waveprotocol.wave.client.scheduler.Scheduler; //导入依赖的package包/类
public void addItem(String text, final Scheduler.Task command) {
  Element elem = Document.get().createAnchorElement();
  elem.setInnerText(text);
  DomHelper.registerEventHandler(elem, "click", new JavaScriptEventListener() {
    @Override public void onJavaScriptEvent(String name, Event event) {
      command.execute();
    }
  });
  element.appendChild(elem);
}
 
开发者ID:ArloJamesBarnes,项目名称:walkaround,代码行数:11,代码来源:DebugMenu.java

示例12: fetchWaveView

import org.waveprotocol.wave.client.scheduler.Scheduler; //导入依赖的package包/类
@Override
public void fetchWaveView(final IdFilter waveletFilter, final boolean fromLastRead, 
    final int minBlipReplySize, final int maxBlipReplySize, final int maxBlipCount, final FetchWaveViewCallback callback) {
  Preconditions.checkState(state == State.INITIAL || state == State.OPENING || state == State.OPENED,
    "Invalid state: %s", state);
  waveService.viewFetchWave(waveletFilter, fromLastRead, minBlipReplySize, maxBlipReplySize, maxBlipCount,
    new FetchWaveCallback() {

    @Override
    public void onSuccess(WaveViewData waveView) {
      if (state == State.INITIAL || state == State.OPENING || state == State.OPENED) {
        if (indexingInProcess) {
          indexingInProcess = false;
          indexingCallback.onIndexingComplete();
        }
        callback.onWaveViewFetch(waveView);
      }
    }

    @Override
    public void onFailure(ReturnStatus status) {
      if (state == State.INITIAL || state == State.OPENING || state == State.OPENED) {
        if (status.getCode() == ReturnCode.INDEXING_IN_PROCESS) {
          indexingInProcess = true;
          String[] parts = status.getMessage().split(" ");
          indexingCallback.onIndexing(Long.parseLong(parts[0]), Long.parseLong(parts[1]));
          repeatRequestScheduler.scheduleDelayed(new Scheduler.Task() {

            @Override
            public void execute() {
              fetchWaveView(waveletFilter, fromLastRead, minBlipReplySize, maxBlipReplySize, maxBlipCount, callback);
            }
          }, REPEAT_REQUEST_WHEN_INDEXING_MS);
        } else {
          callback.onFailure(status);
        }
      }
    }
  });
}
 
开发者ID:jorkey,项目名称:Wiab.pro,代码行数:41,代码来源:ViewChannelImpl.java

示例13: fetchFragments

import org.waveprotocol.wave.client.scheduler.Scheduler; //导入依赖的package包/类
@Override
public void fetchFragments(final WaveletId waveletId, Map<SegmentId, Long> segments, 
    final long endVersion, final int minReplySize, final int maxReplySize, final FetchFragmentsCallback callback) {
  Preconditions.checkState(state == State.INITIAL || state == State.OPENING || state == State.OPENED,
    "Invalid state: %s", state);
  waveService.viewFetchFragments(waveletId, segments, endVersion, minReplySize, maxReplySize,
      new WaveViewService.FetchFragmentsCallback() {

    @Override
    public void onSuccess(Map<SegmentId, RawFragment> rawFragments) {
      if (state == State.INITIAL || state == State.OPENING || state == State.OPENED) {
        if (indexingInProcess) {
          indexingInProcess = false;
          indexingCallback.onIndexingComplete();
        }
        callback.onWaveFragmentsFetch(rawFragments);
      }
    }

    @Override
    public void onFailure(ReturnStatus status) {
      if (state == State.INITIAL || state == State.OPENING || state == State.OPENED) {
        if (status.getCode() == ReturnCode.INDEXING_IN_PROCESS) {
          indexingInProcess = true;
          String[] parts = status.getMessage().split(" ");
          indexingCallback.onIndexing(Long.parseLong(parts[0]), Long.parseLong(parts[1]));
          repeatRequestScheduler.scheduleDelayed(new Scheduler.Task() {

            @Override
            public void execute() {
              fetchFragments(waveletId, null, endVersion, minReplySize, maxReplySize, callback);
            }
          }, REPEAT_REQUEST_WHEN_INDEXING_MS);
        } else {
          callback.onFailure(status);
        }
      }
    }
  });
}
 
开发者ID:jorkey,项目名称:Wiab.pro,代码行数:41,代码来源:ViewChannelImpl.java

示例14: scheduleMutationNotification

import org.waveprotocol.wave.client.scheduler.Scheduler; //导入依赖的package包/类
private void scheduleMutationNotification(ContentElement element) {
  MutationHandler handler = getMutationHandler(element);
  if (handler != null) {
    mutatedElements.add(element);
  }

  Scheduler scheduler = SchedulerInstance.get();
  if (!scheduler.isScheduled(mutationNotificationTask)) {
    scheduler.scheduleDelayed(Priority.MEDIUM, mutationNotificationTask,
        NOTIFY_SCHEDULE_DELAY_MS);
  }
}
 
开发者ID:jorkey,项目名称:Wiab.pro,代码行数:13,代码来源:AnnotationSpreadRenderer.java

示例15: EditorEventHandler

import org.waveprotocol.wave.client.scheduler.Scheduler; //导入依赖的package包/类
/**
 * @param editorInteractor
 * @param subHandler
 */
public EditorEventHandler(EditorInteractor editorInteractor, EditorEventsSubHandler subHandler,
    NodeEventRouter router,
    boolean useWhiteListFlag, boolean useWebkitCompositionFlag) {
  this(new SchedulerTimerService(SchedulerInstance.get(), Scheduler.Priority.CRITICAL),
      editorInteractor, subHandler, router,
      useWhiteListFlag,
      // We may want to turn off composition events for webkit if something goes wrong...
      QuirksConstants.SUPPORTS_COMPOSITION_EVENTS &&
          (UserAgent.isWebkit() ? useWebkitCompositionFlag : true));
}
 
开发者ID:jorkey,项目名称:Wiab.pro,代码行数:15,代码来源:EditorEventHandler.java


注:本文中的org.waveprotocol.wave.client.scheduler.Scheduler类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。