| Summary: | [Progress] IProgressService#busyCursorWhile() opens ProgressMonitorDialog with unmodifyable main taks name | ||||||
|---|---|---|---|---|---|---|---|
| Product: | [Eclipse Project] Platform | Reporter: | Marcin Krzysztof Dabrowski <marcin.dabrowski> | ||||
| Component: | UI | Assignee: | Tod Creasey <Tod_Creasey> | ||||
| Status: | RESOLVED WORKSFORME | QA Contact: | |||||
| Severity: | normal | ||||||
| Priority: | P3 | CC: | ognen.ivanovski, ramon.grunder, titanandrews | ||||
| Version: | 3.2 | Keywords: | helpwanted | ||||
| Target Milestone: | 3.4 | ||||||
| Hardware: | PC | ||||||
| OS: | Windows XP | ||||||
| Whiteboard: | hasPatch | ||||||
| Attachments: |
|
||||||
Please feel free to attach a patch should you have a solution in hand Today I decided to investigate the source of this bug.
And I think that I found it.
When we use PlatformUI.getWorkbench().getProgressService().busyCursorWhile(),
this method creates ProgressMonitorJobsDialog (subclass of ProgressMonitorDialog) and sets its openOnRun property to false.
Finally the problem is placed in class ProgressMonitorDialog in method
private void setMessage(String messageString).
There is this statement:
if (messageLabel == null || messageLabel.isDisposed() || !messageLabel.isVisible()) {
return;
}
which prevents setting task name when messageLabel widget is not created or visible.
ProgressMonitorJobsDialog by default is not opened and became visible before task execution begin, and task name is not set.
So, the resolution is to delete "!messageLabel.isVisible()" condition or to change it to (!messageLabel.isVisible() && openOnRun)
I'll try and look at this in 3.4 Is there a work around for this in Eclipse 3.2? I have the same issue. thanks, Barry There is not currently a workaround for this. This is working in 3.4. I will attach a plug-in to demonstrate. Created attachment 79424 [details]
Example zip
|
3.2 and 3.3M1 When ProgressManager.busyCursorWhile() method is called it after some time it opens ProgresMonitorDialog with unmodifyable main taks name. Running this code: PlatformUI.getWorkbench().getProgressService(). busyCursorWhile(new IRunnableWithProgress() { public void run(IProgressMonitor monitor) { monitor.beginTask("Long running action", 100); // do long runing action logic } }); shows ProgresMonitorDialog with default main task name: "Operation in progress...". But running this code: ProgressMonitorDialog pd = new ProgressMonitorDialog(window.getShell()); pd.run(true, true, new IRunnableWithProgress() { public void run(IProgressMonitor monitor) throws InvocationTargetException, InterruptedException { monitor.beginTask("Long running action", 100); // do long runing action logic } }); shows ProgresMonitorDialog with default main task name: "Long running action". This bug is not present in 3.1.