use of org.eclipse.core.runtime.preferences.IEclipsePreferences 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.eclipse.core.runtime.preferences.IEclipsePreferences in project che by eclipse.
the class ImportOrganizeTest method setOrganizeImportSettings.
protected void setOrganizeImportSettings(String[] order, int threshold, int staticThreshold, IJavaProject project) {
IEclipsePreferences scope = new ProjectScope(project.getProject()).getNode("org.eclipse.jdt.ui");
if (order == null) {
scope.remove(PreferenceConstants.ORGIMPORTS_IMPORTORDER);
scope.remove(PreferenceConstants.ORGIMPORTS_ONDEMANDTHRESHOLD);
} else {
StringBuffer buf = new StringBuffer();
for (int i = 0; i < order.length; i++) {
buf.append(order[i]);
buf.append(';');
}
scope.put(PreferenceConstants.ORGIMPORTS_IMPORTORDER, buf.toString());
scope.put(PreferenceConstants.ORGIMPORTS_ONDEMANDTHRESHOLD, String.valueOf(threshold));
scope.put(PreferenceConstants.ORGIMPORTS_STATIC_ONDEMANDTHRESHOLD, String.valueOf(staticThreshold));
}
}
use of org.eclipse.core.runtime.preferences.IEclipsePreferences 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..
}
}
use of org.eclipse.core.runtime.preferences.IEclipsePreferences in project flux by eclipse.
the class Activator method getConnectedProjectPreferences.
private String[] getConnectedProjectPreferences() {
IEclipsePreferences preferences = InstanceScope.INSTANCE.getNode(PLUGIN_ID);
String[] projects = StringUtils.split(preferences.get(CONNECTED_PROJECTS_ID, ""), ";");
return projects;
}
use of org.eclipse.core.runtime.preferences.IEclipsePreferences in project che by eclipse.
the class JavaProject method getEclipsePreferences.
/**
* Returns the project custom preference pool.
* Project preferences may include custom encoding.
* @return IEclipsePreferences or <code>null</code> if the project
* does not have a java nature.
*/
public IEclipsePreferences getEclipsePreferences() {
if (!org.eclipse.jdt.internal.core.JavaProject.hasJavaNature(this.project))
return null;
// Get cached preferences if exist
PerProjectInfo perProjectInfo = getJavaModelManager().getPerProjectInfo(this.project, true);
if (perProjectInfo.preferences != null)
return perProjectInfo.preferences;
// Init project preferences
IScopeContext context = new ProjectScope(getProject());
final IEclipsePreferences eclipsePreferences = context.getNode(JavaCore.PLUGIN_ID);
// updatePreferences(eclipsePreferences);
perProjectInfo.preferences = eclipsePreferences;
// eclipsePreferences.addPreferenceChangeListener(this.preferencesChangeListener);
return eclipsePreferences;
}
Aggregations