In my Eclipse 3.7 RCP Application I was getting the PreferenceStore as following:
Activator.getDefault().getPreferenceStore() which returns an IPreferenceStore.
Here the Activator’s own preference storage is used.
Now I would like to use use an Instance of ScopedPreferenceStore which is an IPreferenceStore either.
Now the preference storage-node musst be set explicitely, by passing a plugin-id as a qualifier parameter in the constructor ScopedPreferenceStore(IScopeContext context, String qualifier).
Example:
ScopedPreferenceStore(ConfigurationScope.INSTANCE, "com.example.myplugin.id")
Question:
How can I get Activator’s own preference storage qualifier? With other words, how can i create a ScopedPreferenceStore which stores the preferences in Activator’s own preference storage?
If you want to get the equivalent preference store for your bundle without accessing the Activator itself, you would use the same pattern you listed:
EDIT: Finding your bundle id
When eclipse auto-generates your bundle activator, it creates a static field with the bundle id. But if you don’t have an activator, you can still retrieve your bundle id. You can use
FrameworkUtilto get theBundleobject from any one of your classes.