0

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 .

Rajesh Kumar Dash
  • 2,203
  • 6
  • 28
  • 57

1 Answers1

0

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();
greg-449
  • 109,219
  • 232
  • 102
  • 145
  • IPreferenceConstants.RUN_IN_BACKGROUND is also internal.Anything else is there which is not internal – Rajesh Kumar Dash Mar 10 '14 at 10:51
  • Removed `IPreferenceConstants`. Of course if the plugin or preference name ever changes this will start to fail, but this is unlikely for this setting. – greg-449 Mar 10 '14 at 13:42