Community
Participate
Working Groups
see bug# 63604 The following fork=false cases should be converted. Notice, that IProgressService.runInUI will make this straightforward, i.e., no need to change existing logic. * BaseBuildAction * EditorBuildFeatureAction * IncludeFeaturesWizardPage * ReferenceWizardPage * RequiredFeatuesWizardPage * SynchronizeVersionsAction * SynchronizeVersionsWizardPage * JavaAttributeWizard * PluginExportAction * RequiresSection * BuildFeaturesWizardPage * PluginsView * NewExtensionsPointMainPage * NewExtensionTemplateWizard * NewSchemaFileMainPage * NewFeaturePatchWizard * NewFeatureProjectWizard * NewFragmentProjectWizard * NewPluginProjectWizard * NewSiteProjectWizard
runInUI has issues when used from a WizardPage or a modal dialog in general. This needs further investigation, therefore don't change anything yet.
The issue with runInUI is about to be resolved (bug# 63854). Once this fix is released you can go ahead with the conversion. Here is the snippet for converting "false, false" when called from a wizard, where you cannot give a more specific scheduling rule: PlatformUI.getWorkbench().getProgressService().runInUI(getContainer(), runnable, ResourcesPlugin.getWorkspace().getRoot()); However, even more important, here is how you can test whether the conversion has worked. 1) checkout org.eclipse.ui.examples.jobs.ProgressExamplesPlugin from the dev.eclipse.org repository 2) open the Progress examples>job factory view 3) increase the duration to 1 minute 4) check lock the workspace 5) create the job 6) run your operation ->the operation will be blocked by the job you have created above and you should get a Blocked Jobs Dialog.
The code above only makes sense inside a wizard. Remember, in phase one we converted the code that had ProgressMonitorDialog. We lost the dialog so that my code in one example looks like this: try { PlatformUI.getWorkbench().getProgressService().run(false, false, op); } catch (InterruptedException e) { } catch (InvocationTargetException e) { PDEPlugin.logException(e); } No container. Where do I find runnable context in this case?
You have two options: 1) the IProgressService is itself a runnable context: PlatformUI.getWorkbench().getProgressService() 2) use the active workbench window ...getWorkbench().getActiveWorkbenchWindow() Option 1) will always show a progress dialog (no delay before show). This means you can get progress flicker if the operation is short running. The progress monitor in the ApplicationWindow shows up after a delay and in JDT we therefore prefer option 2)
went through some areas, areas left are: * PluginsView * NewExtensionsPointMainPage * NewExtensionTemplateWizard * NewSchemaFileMainPage * NewFeaturePatchWizard * NewFeatureProjectWizard * NewFragmentProjectWizard * NewPluginProjectWizard * NewSiteProjectWizard
This bug is too out of date and will not be fixed. Closing as INVALID.