/** 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(); } }
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()); } }
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()); } } }
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); } }
@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); } }
@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); } } }
public void sleeping(IJobChangeEvent event) { getOrCreateJobInfo(event.getJob()).sleeping(); }
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; } }
public void done(IJobChangeEvent event) { if (event.getJob() == runningJob) { runningJob = null; } }
public void scheduled(IJobChangeEvent event) { if (event.getJob().belongsTo(fPDomManager)) { fPDomManager.fireStateChange(IndexerStateEvent.STATE_BUSY); } }