在我的 Eclipse 3.7 RCP 应用程序中,我得到 PreferenceStore 如下:
Activator.getDefault().getPreferenceStore()
它返回一个IPreferenceStore
. 这里使用了激活器自己的偏好存储。
现在我想使用一个实例,ScopedPreferenceStore
它是一个IPreferenceStore
。
现在必须通过在构造函数中传递一个插件 ID 作为限定符参数来明确设置偏好存储节点ScopedPreferenceStore(IScopeContext context, String qualifier)
。
例子:
ScopedPreferenceStore(ConfigurationScope.INSTANCE, "com.example.myplugin.id")
问题:
如何获得 Activator 自己的偏好存储限定符?换句话说,我如何创建一个ScopedPreferenceStore
将首选项存储在 Activator 自己的首选项存储中的?