Monday 24 November 2014

Eclipse Preference Scope

The Eclipse preferences supports for storing data between application restarts. Preferences are stored as key / value pairs. The key is a String. The value can be a boolean, String, int... etc.

Configuration scope: Preferences stored in this scope are shared by all workspaces that are launched using a particular configuration of Eclipse plug-ins. On a single-user installation, this serves to capture preferences that are common to all workspaces launched by that user. On a multi-user installation, these preferences are shared by all users of the configuration.

Instance scope: Preferences in this scope are specific to a single Eclipse workspace. The old API method getPluginPreferences on Plugin stores its preferences at this scope.

Default scope:. This scope is not stored on disk at all but can be used to store default values for all your keys. When values are not found in other scopes, the default scope is consulted last to provide reasonable default values.

BundleDefaultsScope: Similar to the default scope, these values are not written to disk. They are however read from a particular bundle's "preferences.ini" file.

Project scope: This scope stores values that are specific to a single project in your workspace, such as code formatter and compiler settings. Note that this scope is provided by the org.eclipse.core.resources plug-in, which is not included in the Eclipse Rich Client Platform. This scope will not exist in applications that don’t explicitly include the resources plug-in.

See for more details:

  1. ConfigurationScope
  2. InstanceScope
  3. DefaultScope
  4. ProjectScope