default preferences in RCP (2.7) [message #922736] |
Tue, 25 September 2012 09:23 |
Mauro Condarelli Messages: 428 Registered: September 2009 |
Senior Member |
|
|
Hi,
I have a small RCP App I want to hook into preferences.
Since most values I need are "standard" (fonts, colors, ...) I started adding a default org.eclipse.ui.window.preferences command to my menu.
This correctly opens a Preference dialog with very reduced possibilities (as expected).
Problem is: how do I get those values?
I tried to dump the PreferenceStore with the following code:
preferenceStore = Activator.getDefault().getPreferenceStore();
if (preferenceStore instanceof ScopedPreferenceStore) {
ScopedPreferenceStore sps = (ScopedPreferenceStore) preferenceStore;
for (IEclipsePreferences ep : sps.getPreferenceNodes(true)) {
try {
ep.accept(new IPreferenceNodeVisitor() {
@Override
public boolean visit(IEclipsePreferences node) throws BackingStoreException {
System.out.println(node.absolutePath()+" -> "+node.name());
return true;
}
});
} catch (BackingStoreException e) {
e.printStackTrace();
}
}
}
but it appears empty (only the two root nodes: instance and default are printed):
/instance/it.condarelli.writer.browser -> it.condarelli.writer.browser
/default/it.condarelli.writer.browser -> it.condarelli.writer.browser
Where are the "standard" Preference values?
Can I get hold of them?
TiA
Mauro
|
|
|
Powered by
FUDForum. Page generated in 0.02439 seconds