I am currently facing a issue with a long running job in my rcp application .On starting the job i have a progressbar with 3 buttons and one checkbox .And if user checked the checkbox and pressed the run in background then my progressbar dialog is not coming back. So I tried to use a preference page where User can check and unchecked this settings .But I learnt that I have to use some internal things to do that WorkbenchPlugin.PlatformUI.getPreferenceStore().setValue( IPreferenceConstants.RUN_IN_BACKGROUND, false );

And according to practice I should not do that .So is there any better way or is there any way to remove run in background checkbox from the progressbar dilaog.

Any help on this will be appreciated .

有帮助吗?

解决方案

You can do this without using internal classes with:

IPersistentPreferenceStore store = new ScopedPreferenceStore(InstanceScope.INSTANCE, "org.eclipse.ui.workbench");

store.setValue("RUN_IN_BACKGROUND", false);

store.save();
许可以下: CC-BY-SA归因
不隶属于 StackOverflow
scroll top