Community
Participate
Working Groups
We have a long running User Job that at some point during its execution cannot be cancelled. We need an API to be able to programmatically disable the Cancel button in the Progress dialog or in the progress view
We also need the ability to disable user cancellation for certain Jobs, particularly in the Progress View. There are many background jobs that we run (and BTW we are using the Rich Client Platform) which are started by the system which ought not to be able to be canceled by the user. Unfortunately, even marking them system jobs doesn't put them out of reach of the user since the Progress View allows the user to show system jobs. But even some non-system jobs we would like to make uncancellable by the user. So, specifically, we would like the ability to disable the Cancel button in the Progress View for any Job, system or non-system.
We would love this functionality in our RCP application also.
Created attachment 124330 [details] Partial fix This patch adds set/is Cancelable methods to the Job class. Progress view will honor this property by not showing the red square button. Progress dialog will disable the cancel button. This property is not meant to be dynamic - i.e. UI will not reflect property change while the job is running.
Created attachment 124332 [details] Screenshot of the progress dialog with cancelable and uncancelable jobs.
It's so good. Where can i get path of it ?
(In reply to comment #3) > This patch adds set/is Cancelable methods to the Job class. Progress view will > honor this property by not showing the red square button. Progress dialog will > disable the cancel button. Eugene, if your patch requires modifying code in the Jobs API then I suggest you file a bug against Platform/Runtime with it detailing your needs and keep this bug here for the UI aspects of it.
That would get so more complex from organizational POV - I'm most certain it won't make it into 3.5 (i.e. our product would definitely use it if it was in 3.5). I considered using a Job get/set property for this. The problem is that it will get much more complex for API users to discover how to do this. Q: Is there a chance this will be in 3.5 if I switch to using get/set property? If not, then I will open another bug.
Sending back to inbox for triage.
Just noticed that IProgressConstants is in org.eclipse.ui.progress. Would it be in scope of this PR to patch it?
Created attachment 132831 [details] Alternative API This is another approach we could use: setProperty(IProgressConstants.CANCELABLE_PROPERTY, Boolean.FALSE); This way all changes are limited to org.eclipse.ui.workbench. I created the patch against head as of time I wrote this comment. This approach is still limited - i.e. the property should be set before the Job is scheduled. UI will not reflect changes afterwards.
Is it ok in a broader perspective to make a Job non-cancellable? If so then probably we can add the isCancellable API to the job class itself. Moving to Platform Runtime for comments.
(In reply to comment #11) > Is it ok in a broader perspective to make a Job non-cancellable? If so then > probably we can add the isCancellable API to the job class itself. Moving to > Platform Runtime for comments. I'd like to weigh in and say that I think isCancellable() would be a good improvement to the Job class. This is because there is a small bit of inconsistency here. Cancelation is a *request* on a IProgressMonitor. It does not NEED to be honoured by the Job's run method. However, it IS *always* honoured by the JobManager. Let me explain. If a Job is waiting (scheduled to run after a delay, or blocked) and then cancel() is issued on the Job that Job will not run. The Job hasn't even started running yet and it was killed off. (Note: a way to workaround this is to install a JobChangeListener and reschedule a Job if it is canceled) I like the idea of having an isCancellable() API on Job because then if cancel is issued on a sleeping Job, it will still get a chance to run eliminating the need for a listener and the noise that comes with rescheduling.
I ran into similar requirement for having non-cancelable jobs (user shouldn't be able to cancel the job at any point of time, after he triggered). So there is no way to achieve with current API right? So when do we expect the patch suggested in the thread in Job class. Please let me know for any suggestions/opinions. Thanks in advance.
What is the status of this enhancement?
Is this in limbo? We really want this!
it would also be nice when a job could be set un/cancelable during its run. for example on a long running operation in which a emf resource is loaded you could setCancelable(false) just before the Resource.load(Map) and set it to true just afterwards.
I currently have the same problem here, where I just want to inform the user about a progress that takes some time. This job cannot be canceled, because the application would otherwise not running correctly. When running in background this just informs the user that some function might not work as long the initialization is not finished.
Any update, if this issue is fixed or not. 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.