use of org.osgi.service.prefs.BackingStoreException 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.BackingStoreException 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.BackingStoreException in project xtext-xtend by eclipse.
the class XtendProjectConfigurator method writePreferences.
private void writePreferences(OutputConfiguration configuration, IProject project) {
ProjectScope projectPreferences = new ProjectScope(project);
IEclipsePreferences languagePreferences = projectPreferences.getNode("org.eclipse.xtend.core.Xtend");
languagePreferences.putBoolean(OptionsConfigurationBlock.isProjectSpecificPropertyKey(BuilderConfigurationBlock.PROPERTY_PREFIX), true);
languagePreferences.putBoolean(getKey(configuration, INSTALL_DSL_AS_PRIMARY_SOURCE), configuration.isInstallDslAsPrimarySource());
languagePreferences.putBoolean(getKey(configuration, HIDE_LOCAL_SYNTHETIC_VARIABLES), configuration.isHideSyntheticLocalVariables());
languagePreferences.putBoolean(getKey(configuration, USE_OUTPUT_PER_SOURCE_FOLDER), true);
for (SourceMapping sourceMapping : configuration.getSourceMappings()) {
languagePreferences.put(getOutputForSourceFolderKey(configuration, sourceMapping.getSourceFolder()), Strings.nullToEmpty(sourceMapping.getOutputDirectory()));
}
try {
languagePreferences.flush();
} catch (BackingStoreException e) {
throw new RuntimeIOException(e);
}
}
use of org.osgi.service.prefs.BackingStoreException in project yamcs-studio by yamcs.
the class PreferencesHelper method putBoolean.
private static void putBoolean(String name, boolean value) {
IEclipsePreferences prefs = InstanceScope.INSTANCE.getNode(OPIBuilderPlugin.PLUGIN_ID);
prefs.putBoolean(name, value);
try {
prefs.flush();
} catch (BackingStoreException e) {
OPIBuilderPlugin.getLogger().log(Level.SEVERE, "Failed to store preferences.", e);
}
}
use of org.osgi.service.prefs.BackingStoreException in project flux by eclipse.
the class Activator method addConnectedProjectPreference.
private void addConnectedProjectPreference(String projectName) {
IEclipsePreferences preferences = InstanceScope.INSTANCE.getNode(PLUGIN_ID);
String currentPreferences = preferences.get(CONNECTED_PROJECTS_ID, "");
String[] projects = StringUtils.split(currentPreferences, ";");
for (String existingProjectName : projects) {
if (existingProjectName.equals(projectName)) {
return;
}
}
currentPreferences += ";" + projectName;
preferences.put(CONNECTED_PROJECTS_ID, currentPreferences);
try {
preferences.flush();
} catch (BackingStoreException e) {
// We really don't care that much..
}
}
Aggregations