I have a user Job like this:
Job job = new Job("bla1") {
@Override
protected IStatus run(IProgressMonitor monitor) {
monitor.beginTask("Dummy 2", 100);
for (int i = 0; i < 100; i++) {
if (monitor.isCanceled()) {
return Status.CANCEL_STATUS;
}
System.out.println(i);
try {
Thread.sleep(100);
} catch (InterruptedException e) {
e.printStackTrace();
}
monitor.worked(1);
}
monitor.done();
return Status.OK_STATUS;
}
};
job.setUser(true);
job.schedule();
When this Job starts, I got a progress dialog with 3 buttons: Run in background, Cancel and Details, showing the progress of the job. This is also shown on the status bar. If I press "Run in background", the dialog is hidden but you still see the progress on status bar. If I want to cancel the job, I can not anymore because the dialog can not be shown again even if I press the small button from status bar (Shows background operations in Progress View).
I would be glad if someone could help me :).