Preferences vs. IPreferenceStore [message #334663] |
Mon, 23 February 2009 22:20 |
Eclipse User |
|
|
|
Originally posted by: eclipse-news.rizzoweb.com
Today I realized that we have this very strange duality of
org.eclipse.core.runtime.Preferences and
org.eclipse.jface.preference.IPreferenceStore - their interfaces are
essentailly the same.
I'm sure there is some story about why IPreferenceStore was created
instead of leveraging Preferences, and why IPreferenceStore is not in
org.eclipse.core.runtime so Preferences could just implement it.
This seems to create problems when you want to have a
FieldEditorPreferencePage that controls preferences that a non-UI plugin
needs to read. The page needs an IPreferencesStore but the non-UI plugin
only has a Preferences.
Why is this so complicated?
After some searching, I did find
org.eclipse.jdt.internal.ui.text.PreferencesAdapter which seems to be
exactly the bridge that is needed here. But, alas, it is not API. Why
not? It does not appear to have any significant dependencies to the rest
of JDT and is a pretty simple (if lengthy) class. Is there some hidden
reason why it is not available for others to leverage? Is it worth
filing a bug about that? (BTW, it seems DLTK has a very similar class,
and it is not in an internal package. There are also other classes
scattered around whose names suggest they do something similar.)
I'm just very surprised this is so much effort to get working - a UI
for preferences used by non-UI plugins. Really? Am I missing something?
Eric
|
|
|
Powered by
FUDForum. Page generated in 0.02636 seconds