Repository navigation
Add option to make the dialog of the busyCursorWhile non-cancelable - #4515
fedejeanne wants to merge 2 commits into
Conversation
busyCursorWhile non-cancelable
There was a problem hiding this comment.
🟡 Changes recommended
The new tests can pass without displaying the dialog, leaving the user-visible Cancel-button behavior unverified.
1 open issue
What changed in this PR
Adds optional cancellation control to workbench and E4 busyCursorWhile, preserving existing behavior for callers of the original overload.
Changes:
- Adds and propagates a
cancelableparameter. - Adds cancellation checkboxes to both Job Factory examples.
- Adds Cancel-button tests and bumps the E4 progress bundle version.
| File | Description |
|---|---|
| tests/org.eclipse.ui.tests/Eclipse UI Tests/org/eclipse/ui/tests/progress/ProgressServiceTest.java | Tests Cancel-button enablement. |
| examples/org.eclipse.ui.examples.job/src/org/eclipse/ui/examples/jobs/views/JobsView.java | Adds cancellation checkbox. |
| examples/org.eclipse.e4.ui.examples.job/src/org/eclipse/e4/ui/examples/jobs/views/JobsView.java | Adds E4 cancellation checkbox. |
| bundles/org.eclipse.ui.workbench/eclipseui/org/eclipse/ui/progress/IProgressService.java | Declares workbench overload. |
| bundles/org.eclipse.ui.workbench/eclipseui/org/eclipse/ui/internal/progress/WorkbenchSiteProgressService.java | Delegates new overload. |
| bundles/org.eclipse.ui.workbench/eclipseui/org/eclipse/ui/internal/progress/ProgressManager.java | Applies cancellation option. |
| bundles/org.eclipse.e4.ui.progress/src/org/eclipse/e4/ui/progress/IProgressService.java | Declares E4 overload. |
| bundles/org.eclipse.e4.ui.progress/src/org/eclipse/e4/ui/progress/internal/ProgressServiceImpl.java | Applies E4 cancellation option. |
| bundles/org.eclipse.e4.ui.progress/META-INF/MANIFEST.MF | Bumps bundle version to 0.6.0. |
Review effort: Balanced
902a28b to
6ad8f21
Compare
|
Thanks for the PR, Federico, and for the screenshot, it makes the behavior easy to see. I have some concerns about the direction, though. I see two cases:
Two further points:
Could you share the concrete use case (a caller that must block, can't be canceled, and isn't short)? |
busyCursorWhile always showed an enabled Cancel button. The new overload disables it from the start for operations that can't be canceled while keeping the input blocking of busyCursorWhile. Add "cancelable" option to the JobsView examples Cancel delayed progress dialog after busy cursor run (e4), same as it was done in b95f727 for the ProgressManager. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
6ad8f21 to
1ea502b
Compare
|
Thanks Christoph, fair points.
eclipse-jdt/eclipse.jdt.ui#2415: save actions that need an AST (e.g. Organize Imports) compute it in
You're right. I removed that change from this PR. Every overload now behaves as on master: closing the dialog while the operation runs is ignored. New tests pin that down.
Removed as well.
Done. The PR now only adds the overload, plus a port of |
|
I looked at the source, and I'm not yet convinced the use case needs a non-cancelable blocking dialog. Typing conflicts: Cancelation:
Could the save action instead run cancelable and restart on edit? |

busyCursorWhilealways showed an enabled Cancel button. The new overload disables it from the start for operations that can't be canceled while keeping the input blocking ofbusyCursorWhile.How to test
Use the newly added checkbox in the Job Factory view: if you uncheck it then the Cancel button is grayed out.