use of org.osgi.service.prefs.Preferences in project azure-tools-for-java by Microsoft.
the class PreferenceUtil method getPreferenceKeys.
public static String[] getPreferenceKeys() {
String[] keys = null;
try {
Preferences prefs = PluginUtil.getPrefs(com.microsoft.azuretools.core.utils.Messages.prefFileName);
keys = prefs.keys();
} catch (BackingStoreException e) {
Activator.getDefault().log("Error", e);
}
return keys;
}
use of org.osgi.service.prefs.Preferences in project azure-tools-for-java by Microsoft.
the class PreferenceUtil method savePreferences.
public static void savePreferences(String name, String[] values) {
Preferences prefs = PluginUtil.getPrefs(com.microsoft.azuretools.core.utils.Messages.prefFileName);
prefs.put(name, convertToPreference(values));
try {
prefs.flush();
} catch (BackingStoreException e) {
Activator.getDefault().log("Error", e);
}
}
use of org.osgi.service.prefs.Preferences in project tdi-studio-se by Talend.
the class Log4jPrefsSettingManager method saveLog4jNodeIntoPref.
public void saveLog4jNodeIntoPref(final String prefNode, final String value) {
try {
Preferences log4jSettings = null;
if (!isLog4jPrefsExist()) {
// if not exist,create it
log4jSettings = getLog4jPreferences(prefNode, true);
} else {
log4jSettings = getLog4jPreferences(prefNode, false);
}
if (log4jSettings != null) {
log4jSettings.put(prefNode, value);
// save log4j activate to prefs
log4jSettings.flush();
}
} catch (BackingStoreException e) {
ExceptionHandler.process(e);
}
}
use of org.osgi.service.prefs.Preferences in project tdi-studio-se by Talend.
the class Log4jPrefsSettingManager method getValueOfPreNode.
public String getValueOfPreNode(String nodeName) {
Preferences nodePre = null;
nodePre = getLog4jPreferences(nodeName, false);
if (nodePre == null) {
return Boolean.FALSE.toString();
}
return nodePre.get(nodeName, null);
}
use of org.osgi.service.prefs.Preferences in project jop by jop-devel.
the class JOPUIUtils method getProjectSetting.
public static String getProjectSetting(ILaunchConfiguration configuration, String key, String def) {
String projectName = getProjectName(configuration);
if (projectName == null) {
return def;
}
IProject project = ResourcesPlugin.getWorkspace().getRoot().getProject(projectName);
IScopeContext scopeContext = new ProjectScope(project);
Preferences projectPrefs = scopeContext.getNode(IJOPUIConstants.PLUGIN_ID);
return projectPrefs.get(key, def);
}
Aggregations