use of org.osgi.service.prefs.Preferences in project webtools.sourceediting by eclipse.
the class XPathProcessorHandler method toggleState.
protected void toggleState(String xpathState) {
Preferences osgiPrefs = XPathCoreHelper.getPreferences();
if (xpathState.equals("xpath10")) {
osgiPrefs.putBoolean(XPathProcessorPreferences.XPATH_1_0_PROCESSOR, true);
osgiPrefs.putBoolean(XPathProcessorPreferences.XPATH_2_0_PROCESSOR, false);
} else if (xpathState.equals("xpath2")) {
osgiPrefs.putBoolean(XPathProcessorPreferences.XPATH_1_0_PROCESSOR, false);
osgiPrefs.putBoolean(XPathProcessorPreferences.XPATH_2_0_PROCESSOR, true);
}
try {
osgiPrefs.flush();
} catch (BackingStoreException ex) {
XPathUIPlugin.log(ex);
}
}
use of org.osgi.service.prefs.Preferences in project webtools.sourceediting by eclipse.
the class ContentBasedPreferenceGateway method getPreferencesString.
public static String getPreferencesString(IContentType contentType, String key) {
Preferences preferences = getPreferences(contentType);
String value = preferences.get(key, getDefaultPreferences(contentType).get(key, null));
return value;
}
use of org.osgi.service.prefs.Preferences in project webtools.sourceediting by eclipse.
the class ContentBasedPreferenceGateway method getPreferencesString.
public static String getPreferencesString(String contentTypeId, String key) {
Preferences preferences = getPreferences(contentTypeId);
String value = preferences.get(key, getDefaultPreferences(contentTypeId).get(key, null));
return value;
}
use of org.osgi.service.prefs.Preferences in project webtools.sourceediting by eclipse.
the class TestPreferences method testContentBasedPrefXML.
public void testContentBasedPrefXML() {
IContentType contentType = Platform.getContentTypeManager().findContentTypeFor("test.xml");
Preferences preferences = ContentBasedPreferenceGateway.getPreferences(contentType);
assertNotNull(preferences);
}
use of org.osgi.service.prefs.Preferences in project webtools.sourceediting by eclipse.
the class TestPreferences method displayPreferenceTree.
private void displayPreferenceTree() {
IEclipsePreferences eclipsePreferences = Platform.getPreferencesService().getRootNode();
try {
String[] children = eclipsePreferences.childrenNames();
System.out.println(eclipsePreferences.absolutePath());
printChildren(children);
for (int i = 0; i < children.length; i++) {
String string = children[i];
Preferences preferences = eclipsePreferences.node(string);
printChildren(preferences);
}
} catch (BackingStoreException e) {
e.printStackTrace();
}
}
Aggregations