0

Is it possible to disable the "Cancel" button in the progress dialog displayed when a job is running? I still want to maintain the functionality to show to user about progress in the job to the background. Letting the job run or canceling it has no effect on the GUI, as it starts a task on a remote server, which does not support cancellation/stopping the task, once started.

I cannot use setSystem(true) since I want to show the progress to the user.

There is bug reported even in Eclipse Bugzilla but there isnt any update https://bugs.eclipse.org/bugs/show_bug.cgi?id=155479

Trying to figure out if this issue is fixed or not. If not how do we handle such scenario.

Any help appreciated.Thank you.

SDS
  • 457
  • 5
  • 17

1 Answers1

0

That bug is still open and has not been fixed.

I think the nearest you can get is to use ProgressMonitorDialog to run an IRunnableWithProgress class. You can set the cancelable state of ProgressMonitorDialog.

Something like:

ProgressMonitorDialog dialog = new ProgressMonitorDialog(shell);

dialog.setCancelable(false);

dialog.run(true, true, runnableWithProgress);
greg-449
  • 109,219
  • 232
  • 102
  • 145
  • I did try using ProgressMonitorDialog but got `SWT no more handle` exception, since my rcp has many background jobs running and when we open ProgressMonitorDialog there are no resources available. I am using a Job to start the embedded server and load the SWT Browser with HTML files. Is there any other way to avoid this situation?? – SDS Mar 22 '16 at 22:13