Ejemplo n.º 1
0
 /** Reverses the actions of {@link JobDoneListener#scheduled(IJobChangeEvent)} */
 @Override
 public void done(final IJobChangeEvent event) {
   if (event.getResult() == Status.OK_STATUS || event.getResult() == Status.CANCEL_STATUS) {
     UIJob refreshJob =
         new UIJob(REFRESH_STATISTICS_VIEW) {
           @Override
           public IStatus runInUIThread(IProgressMonitor monitor) {
             Job job = event.getJob();
             if (job instanceof ITreeJob) {
               final LongRunningJob<?> treeJob = (LongRunningJob<?>) job;
               LongRunningMethod<?> method = treeJob.getMethod();
               final boolean expand =
                   (method instanceof StatisticTreeJob) && ((StatisticTreeJob) method).isExpand();
               runningJobs.remove(treeJob);
               final Parent calc = ((TreeJob) method).getCalculated();
               calc.startCalculating(false);
               checkViews();
               synchronized (views) {
                 for (TreeViewer view : views) {
                   view.refresh(calc);
                   if (expand) {
                     view.expandToLevel(calc, 1);
                   }
                 }
               }
             }
             return Status.OK_STATUS;
           }
         };
     refreshJob.setPriority(Job.INTERACTIVE);
     refreshJob.schedule();
   }
 }
Ejemplo n.º 2
0
 public void done(IJobChangeEvent event) {
   JobsManager.getInstance().removeCanceled(event.getJob());
   synchronized (jobs) {
     boolean reschedule = TeslaSWTAccess.getJobEventReSchedule(event) && state;
     getOrCreateJobInfo(event.getJob()).done(reschedule);
     if (needDisable && isJoinEmpty()) {
       disable();
     }
     if (!reschedule) jobs.remove(event.getJob());
   }
 }
Ejemplo n.º 3
0
 public void scheduled(IJobChangeEvent event) {
   if (!state) {
     return;
   }
   JobInfo jobInfo = getOrCreateJobInfo(event.getJob());
   jobInfo.scheduled(event.getDelay());
   if (JobStatus.REQUIRED.equals(jobInfo.status)) {
     if (event.getJob().belongsTo(TeslaSWTAccess.getDecoratorManagerFamily())) {
       JobsManager.getInstance().nulifyTime(event.getJob());
     }
     if (jobInfo.rescheduleCounter < TeslaLimits.getJobNullifyRescheduleMaxValue()) {
       JobsManager.getInstance().nulifyTime(event.getJob());
     }
   }
 }
Ejemplo n.º 4
0
 public void done(IJobChangeEvent event) {
   if (event.getJob().belongsTo(fPDomManager)) {
     if (Job.getJobManager().find(fPDomManager).length == 0) {
       fPDomManager.fireStateChange(IndexerStateEvent.STATE_IDLE);
     }
   }
 }
 /**
  * @param action
  * @param showInstalledJob
  * @param event
  */
 private void updateContributedUI(
     final ShowContributedExtensionsJob showContributedJob, final IJobChangeEvent event) {
   if (event.getResult().isOK()) {
     // update exchange view
     List<ComponentExtension> extensions = showContributedJob.getfContributedExtensions();
     ExchangeManager.getInstance().updateContributedExtensions(extensions);
   }
 }
  /**
   * Update ui after job finished.
   *
   * @param action
   * @param job
   * @param event
   */
  private void updateUI(final RefreshJob job, final IJobChangeEvent event) {
    // activate action again after job finished

    if (event.getResult().isOK()) {
      // update exchange view
      List<ComponentExtension> extensions = job.getAvailableExtensions();
      ExchangeManager.getInstance().updateAvailableExtensions(extensions);
    }
  }
Ejemplo n.º 7
0
      @Override
      public void done(final IJobChangeEvent event) {
        IStatus iStatus = event.getResult();
        String message = iStatus.getMessage();

        if (IStatus.OK != iStatus.getSeverity()) {
          log.log(Level.WARNING, "This action's status :" + message);
        }
      }
Ejemplo n.º 8
0
 @Override
 public void scheduled(IJobChangeEvent event) {
   if (fixedTheJob) return;
   Job job = event.getJob();
   if (job == null) return;
   Class<? extends Job> jobClazz = job.getClass();
   if (!job.isSystem()
       && jobClazz
           .getName()
           .equals("org.eclipse.egit.core.internal.indexdiff.IndexDiffCacheEntry$5")) {
     try {
       Field field = InternalJob.class.getDeclaredField("flags");
       field.setAccessible(true);
       field.set(
           job, ((Integer) field.get(job)).intValue() | 0x0100 /*InternalJob.M_SYSTEM*/);
       if (log.isInfoEnabled()) {
         log.info("Made job '" + job + "' a system job.");
       }
       fixedTheJob = true;
     } catch (Exception e) {
       log.error(e.getMessage(), e);
     }
   }
 }
Ejemplo n.º 9
0
 public void sleeping(IJobChangeEvent event) {
   getOrCreateJobInfo(event.getJob()).sleeping();
 }
Ejemplo n.º 10
0
 public void awake(IJobChangeEvent event) {
   getOrCreateJobInfo(event.getJob()).awake();
 }
 @Override
 public void scheduled(IJobChangeEvent event) {
   if ("Local Waveform Release".equals(event.getJob().getName())) {
     jobScheduled = true;
   }
 }
Ejemplo n.º 12
0
 public void done(IJobChangeEvent event) {
   if (event.getJob() == runningJob) {
     runningJob = null;
   }
 }
Ejemplo n.º 13
0
 public void scheduled(IJobChangeEvent event) {
   if (event.getJob().belongsTo(fPDomManager)) {
     fPDomManager.fireStateChange(IndexerStateEvent.STATE_BUSY);
   }
 }