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.
153154155156157158159160161162163
} return status; } }; job.addJobChangeListener(new JobChangeAdapter() { @Override public void done(final IJobChangeEvent event) { Display.getDefault().asyncExec(new Runnable() { public void run() {
172173174175176177178179180181182
return Status.OK_STATUS; } }; installDir.setText(selectedDirectory); jobListener = new JobChangeAdapter() { public void done(IJobChangeEvent event) { installRuntimeJob.removeJobChangeListener(this); installRuntimeJob = null; Display.getDefault().asyncExec(new Runnable() { public void run() {
104105106107108109110111112113114
"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(){
383384385386387388389390391392393
} return Status.OK_STATUS; } }; job.addJobChangeListener(new JobChangeAdapter(){ public void done(IJobChangeEvent event) { action.setEnabled(true); }
101102103104105106107108109110111
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();
250251252253254255256257258259260
*/ private IWorkbenchAdapter getWorkbenchAdapter(Object element) { return (IWorkbenchAdapter) Util.getAdapter(element, IWorkbenchAdapter.class); } }; job.addJobChangeListener(new JobChangeAdapter() { /* * (non-Javadoc) * * @see org.eclipse.core.runtime.jobs.JobChangeAdapter#done(org.eclipse.core.runtime.jobs.IJobChangeEvent) */
5354555657585960616263
* Add a job change listeners that handles a done * event if the result was IStatus.OK. * */ private void addDefaultJobChangeListener() { addJobChangeListener(new JobChangeAdapter() { /* (non-Javadoc) * @see org.eclipse.core.runtime.jobs.JobChangeAdapter#done(org.eclipse.core.runtime.jobs.IJobChangeEvent) */ public void done(IJobChangeEvent event) {
388389390391392393394395396397398
} model.disableUI(parts, blockUntilSaved); // Add a listener for enabling the UI after the save job has // finished, and for displaying an error dialog if // necessary. saveJob.addJobChangeListener(new JobChangeAdapter() { public void done(final IJobChangeEvent event) { ((InternalSaveable) model).setBackgroundSaveJob(null); shellProvider.getShell().getDisplay().asyncExec( new Runnable() { public void run() {
145146147148149150151152153154155
searches.put(editor, new ArrayList<Search>()); } searches.get(editor).add(search); // This listener ensures that only one search can be // performed at the same time for an editor search.addJobChangeListener(new JobChangeAdapter() { @Override public void done(IJobChangeEvent event) { if (event.getResult().isOK()) { logger.debug("Search completed successfully."); search.getSearchResult().notifyObservers(
148149150151152153154155156157158