1
votes

In our Eclipse RCP application, we have several long running jobs, which are displayed with the standard progress monitor dialog from Eclipse. Within this dialog, the user as the option to check "Always run in background". We want to give the user access to this option via a preference page so that he can turn the preference on/off.

In our preference page, the preference is accessed via IPreferenceConstants.RUN_IN_BACKGROUND and is stored in the preference store WorkbenchPlugin.getDefault().getPreferenceStore(), both which access internal libraries.

As a good practice, we want to remove all access to internal libs from our application, so how can we achieve this while keeping the preference available to the user?

I tried switching the progress monitor dialog to a different preference store and a different preference name, but I cannot see how this would be done, because we are just implementing a Job a the monitor is given to us as a parameter in the run() method.

I'm using Eclipse 3.7 as target platform.

1

1 Answers

0
votes

The code which uses this preference is org.eclipse.ui.internal.progress.ProgressManager. This is installed in the Job Manager as the Progress Provider and provides the IProgressMonitor to be used for jobs.

It is technically possible to set a new progress provider in the job manager but since ProgressManager also provides the IProgressService this may be difficult in practice (it depends on how much of Eclipse core services your RCP uses).

So in practice I don't think there is anything you can do.