use of org.eclipse.core.runtime.preferences.IScopeContext in project flux by eclipse.
the class StubUtility method getLineDelimiterPreference.
public static String getLineDelimiterPreference(IProject project) {
IScopeContext[] scopeContext;
if (project != null) {
// project preference
scopeContext = new IScopeContext[] { new ProjectScope(project) };
String lineDelimiter = Platform.getPreferencesService().getString(Platform.PI_RUNTIME, Platform.PREF_LINE_SEPARATOR, null, scopeContext);
if (lineDelimiter != null)
return lineDelimiter;
}
// workspace preference
scopeContext = new IScopeContext[] { InstanceScope.INSTANCE };
// $NON-NLS-1$ //$NON-NLS-2$
String platformDefault = System.getProperty("line.separator", "\n");
return Platform.getPreferencesService().getString(Platform.PI_RUNTIME, Platform.PREF_LINE_SEPARATOR, platformDefault, scopeContext);
}
use of org.eclipse.core.runtime.preferences.IScopeContext in project jop by jop-devel.
the class JOPUIUtils method setProjectSetting.
public static void setProjectSetting(ILaunchConfiguration configuration, String key, String value) {
String projectName = getProjectName(configuration);
if (projectName == null) {
return;
}
IProject project = ResourcesPlugin.getWorkspace().getRoot().getProject(projectName);
IScopeContext scopeContext = new ProjectScope(project);
Preferences projectPrefs = scopeContext.getNode(IJOPUIConstants.PLUGIN_ID);
projectPrefs.put(key, value);
}
use of org.eclipse.core.runtime.preferences.IScopeContext in project jop by jop-devel.
the class JOPPropertyPage method performOk.
/* (non-Javadoc)
* @see org.eclipse.jface.preference.FieldEditorPreferencePage#performOk()
*/
@Override
public boolean performOk() {
IScopeContext scopeContext = new ProjectScope(getProject());
Preferences projectPrefs = scopeContext.getNode(IJOPUIConstants.PLUGIN_ID);
if (isValid()) {
projectPrefs.put(IJOPLaunchConfigurationConstants.ATTR_JOP_HOME, jopDirectoryEditor.getStringValue());
projectPrefs.put(IJOPLaunchConfigurationConstants.ATTR_QUARTUS_PROJECT, quartusProjectFileEditor.getStringValue());
}
return super.performOk();
}
use of org.eclipse.core.runtime.preferences.IScopeContext in project jop by jop-devel.
the class JOPPropertyPage method performDefaults.
/* (non-Javadoc)
* @see org.eclipse.jface.preference.FieldEditorPreferencePage#performDefaults()
*/
@Override
public void performDefaults() {
super.performDefaults();
IProject project = getProject();
IPath projectRoot = project.getLocation();
IScopeContext scopeContext = new ProjectScope(project);
Preferences projectPrefs = scopeContext.getNode(IJOPUIConstants.PLUGIN_ID);
jopDirectoryEditor.setStringValue(projectPrefs.get(IJOPLaunchConfigurationConstants.ATTR_JOP_HOME, projectRoot.toOSString()));
IPath defaultQuartusProjectFile = projectRoot.append("quartus").append("cycmin").append("jop").addFileExtension("qpf");
quartusProjectFileEditor.setStringValue(projectPrefs.get(IJOPLaunchConfigurationConstants.ATTR_QUARTUS_PROJECT, defaultQuartusProjectFile.toOSString()));
}
use of org.eclipse.core.runtime.preferences.IScopeContext 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