Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Rich Client Platform (RCP) » default preferences in RCP (2.7)
default preferences in RCP (2.7) [message #922736] Tue, 25 September 2012 09:23
Mauro Condarelli is currently offline Mauro Condarelli
Messages: 417
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
Previous Topic:How to Incorporate Spring IOC concept in Eclipse RCP
Next Topic:org.eclipse.jdt.ui.javaEditorTextHovers and eclipse 4.2
Goto Forum:
  


Current Time: Wed Sep 17 13:51:57 GMT 2014

Powered by FUDForum. Page generated in 0.01753 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software