예제 #1
0
  /**
   * Starts a job which reads the contents of the directory in the background.
   *
   * @param rootNode
   * @return the created and already scheduled job
   */
  @Nonnull
  public Job createAndScheduleImportInitialConfiguration(
      @Nonnull final IAlarmSubtreeNode rootNode) {
    LOG.debug("Start import initial configuration."); // $NON-NLS-1$
    final IWorkbenchSiteProgressService progressService =
        (IWorkbenchSiteProgressService) getSite().getAdapter(IWorkbenchSiteProgressService.class);

    final Job importInitialConfigJob = JobFactory.createImportInitialConfigJob(this, rootNode);

    // This means updates will be queued for later application.
    _alarmListener.startUpdateProcessing();

    // The directory is read in the background. Until then, set the viewer's
    // input to a placeholder object.
    _viewer.setInput(new Object[] {new PendingUpdateAdapter()});

    // Start the directory reader job.
    progressService.schedule(importInitialConfigJob, 0, true);
    return importInitialConfigJob;
  }
예제 #2
0
  /** Starts the connection. */
  private void createAndScheduleConnectionJob() {
    LOG.debug("Starting connection."); // $NON-NLS-1$

    final IWorkbenchSiteProgressService progressService =
        (IWorkbenchSiteProgressService) getSite().getAdapter(IWorkbenchSiteProgressService.class);

    final ConnectionJob connectionJob = JobFactory.createConnectionJob(this);

    // Gain access to the connection
    connectionJob.addJobChangeListener(
        new JobChangeAdapter() {

          @SuppressWarnings("synthetic-access")
          @Override
          public void done(@Nullable final IJobChangeEvent event) {
            _connection = connectionJob.getConnection();
          }
        });

    progressService.schedule(connectionJob, 0, true);
  }
예제 #3
0
  private void scheduleFormatJob() {
    IWorkbenchSiteProgressService siteService =
        (IWorkbenchSiteProgressService) partSite.getAdapter(IWorkbenchSiteProgressService.class);
    if (siteService == null) return;
    FormatJob.FormatRequest formatRequest =
        new FormatJob.FormatRequest(
            getRepository(),
            commit,
            fill,
            currentDiffs,
            SYS_LINKCOLOR,
            SYS_DARKGRAY,
            SYS_HUNKHEADER_COLOR,
            SYS_LINES_ADDED_COLOR,
            SYS_LINES_REMOVED_COLOR,
            allRefs);
    formatJob = new FormatJob(formatRequest);
    addDoneListenerToFormatJob();
    siteService.schedule(formatJob, 0 /* now */, true /*
														 * use the half-busy
														 * cursor in the part
														 */);
  }
예제 #4
0
  protected void initProgressService(IWorkbenchSiteProgressService progressService) {
    progressService.showBusyForFamily(ResourcesPlugin.FAMILY_MANUAL_BUILD);
    progressService.showBusyForFamily(ResourcesPlugin.FAMILY_AUTO_BUILD);

    progressService.showBusyForFamily(REFRESH_MARKERS_JOB_FAMILY);
  }