Community
Participate
Working Groups
An IRunnable in the WorkbenchAdvisor#initialize method does not show the dialog, however it does show in RCP. I have attached a project demonstrating the bug RAP single sourced with the RCP implementation that does work. See the ApplicationWorkbenchWindowAdvisor class in the rap.bugs project and rap.bugs package.
Created attachment 114210 [details] Small project that demonstrates the bug.
Created attachment 126355 [details] Fix Background: For the ProgressMonitorDialog to work in RAP, the UICallBack should be enabled when the IRunnableWithProgress is executed. The runnable passed to ProgressMonitorDialog#run method is executed in a separate thread, depending on the value of the fork argument. If the runnable is to be executed in a separate thread, then the ModalContext#run method crates a new ModalContextThread which activates the UICallBack and the progress dialog is correctly shown. The problem: At such early stage (when ApplicationWorkbenchAdvisor#initialize is called), the Workbench disallow running the IRunnableWithProgress in a separate thread by calling ModalContext.setAllowReadAndDispatch(false). Since UICallBack is enabled only if the runnable is run in the ModalContextThread, this effectively prevents the progress dialog from being shown on the screen. The solution (?) The attached patch works by commenting out the call to ModalContext.setAllowReadAndDispatch(false) in the Workbwench code. It solves the problem at hand and looks harmless enough, but I'm not 100% sure that the modification in completely benign.
Committed patch as described in comment #2