Text Editor\" in the Preference dialog. But this also means call to that" />
开发者

Using more than one preference store for Eclipse Editor Plugin

I have an editor that extends TextEditor. This defaults to having access to Text Editor preferences which is set via "Editor > Text Editor" in the Preference dialog. But this also means call to that getPreferenceStore() will return the TextEditor preference store.

I don't mind this, except I would also like to have a second preference store with preferences 开发者_如何学Gospecific to my editor.

How would I go about doing this without the 2 preferences conflicting each other?

Would I need to declare the second preference store locally to my Plugin/Activator class and override the getPreferenceStore() method locally? If so, would EditorsPlugin.getDefault().getPreferenceStore() and MyEditorPlugin.getDefault().getPreferenceStore() return appropriate preferences?

Thanks!


I don't thinks there is any problem. You have your editor extend TextEditor,you use your MyEditorPlugin.getDefault().getPreferenceStore(), the two perfreence store are totally separated. You can create your own PropertyChangeListener to listen property change. In all, you can do everything you like because the two perference store are totally separated. You can you can handle your own perference using the standard listener mechanism.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜