IJobChangeListener
Classes that wish to listen to the progress of scheduled jobs can extend this class and override only the methods which they are interested in.
390391392393394395396397398399400
}; refreshJob.setSystem(true); refreshJob.setRule(ResourcesPlugin.getWorkspace().getRoot()); if (runAfter != null) { refreshJob.addJobChangeListener(new JobChangeAdapter() { @Override public void done(final IJobChangeEvent event) { runAfter.run();
7071727374757677787980
"Preparing Google Web Application Project", fJavaProject, Activator.getDefault().getBundle(),true); PlatformUI.getWorkbench().getProgressService().showInDialog( null, prepareGaeProject); prepareGaeProject.schedule(); prepareGaeProject.addJobChangeListener(new JobChangeAdapter(){ public void done(IJobChangeEvent event) { if (event.getResult().isOK()){ Display.getDefault().asyncExec(new Runnable(){
189190191192193194195196197198199
populateButton.setEnabled(true); return new Status(IStatus.OK, DestecsDebugPlugin.PLUGIN_ID, "Enabled populate button"); } }; populator.addJobChangeListener(new JobChangeAdapter() { public void done(IJobChangeEvent event) { changeButton.schedule();
204205206207208209210211212213214
226227228229230231232233234235236
*/ public IJobChangeListener getJobChangeListener(final Job job, boolean useHalfBusyCursor) { if (listener == null) { updateJob.useWaitCursor = useHalfBusyCursor; listener = new JobChangeAdapter() { /* * (non-Javadoc) * * @see org.eclipse.core.runtime.jobs.JobChangeAdapter#aboutToRun(org.eclipse.core.runtime.jobs.IJobChangeEvent) */
385386387388389390391392393394395
/** * Create the IJobChangeListener registered with the Job manager. */ private void createChangeListener() { changeListener = new JobChangeAdapter() { /* * (non-Javadoc) * * @see org.eclipse.core.runtime.jobs.JobChangeAdapter#aboutToRun(org.eclipse.core.runtime.jobs.IJobChangeEvent)
115116117118119120121122123124125
* Returns a listener that will close the dialog when the job completes. * * @return IJobChangeListener */ private IJobChangeListener createCloseListener() { return new JobChangeAdapter() { /* * (non-Javadoc) * * @see org.eclipse.core.runtime.jobs.IJobChangeListener#done(org.eclipse.core.runtime.jobs.IJobChangeEvent) */
5354555657585960616263
public JobWatcher( final String jobName ) { this.jobName = jobName; // register a job listener that checks if the job is finished listener = new JobChangeAdapter() { public void done( IJobChangeEvent event ) { // if the done job has the expected name we are done
4748495051525354555657
* displaying a progress monitor. */ @Override protected void work(final IWorkbenchPart part, IResource resource, final List<WorkItem> resources) { FindBugsJob clearMarkersJob = new ClearMarkersJob(resource, resources); clearMarkersJob.addJobChangeListener(new JobChangeAdapter() { @Override public void done(IJobChangeEvent event) { refreshViewer(part, resources); } });
96979899100101102103104105106
public void run() { if (MessageDialog.openConfirm(Display.getCurrent().getActiveShell(), "Fix dependencies", "Alter dependencies?\n\nAnything marked in green will be synchronized.")) { Job job = new SyncIvyFilesJob(dependencies); job.addJobChangeListener(new JobChangeAdapter() { public void done(IJobChangeEvent arg0) { refresh(true); } }); job.schedule();