use of org.eclipse.core.resources.ProjectScope in project xtext-xtend by eclipse.
the class UnicodeEscapeTest method getProject.
private IProject getProject(String encoding) throws CoreException {
IProject project = workbenchTestHelper.getProject();
ScopedPreferenceStore projectPreferenceStore = new ScopedPreferenceStore(new ProjectScope(project), Platform.PI_RUNTIME);
projectPreferenceStore.setValue(Platform.PREF_LINE_SEPARATOR, "\n");
project.setDefaultCharset(encoding, null);
return project;
}
use of org.eclipse.core.resources.ProjectScope in project xtext-xtend by eclipse.
the class XtendPreferenceStoreAccess method getContextPreferenceStore.
@SuppressWarnings("all")
@Override
public IPreferenceStore getContextPreferenceStore(Object context) {
IProject project = getProject(context);
if (project == null)
return getPreferenceStore();
IPreferenceStore store = super.getContextPreferenceStore(context);
ProjectScope projectScope = new ProjectScope(project);
FixedScopedPreferenceStore jdtStore = new FixedScopedPreferenceStore(projectScope, JavaCore.PLUGIN_ID);
jdtStore.setSearchContexts(new IScopeContext[] { projectScope, new InstanceScope(), new ConfigurationScope() });
return new ChainedPreferenceStore(new IPreferenceStore[] { store, jdtStore, PreferenceConstants.getPreferenceStore() });
}
use of org.eclipse.core.resources.ProjectScope 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.eclipse.core.resources.ProjectScope in project jbosstools-openshift by jbosstools.
the class ServerUtils method getProjectNode.
public static IEclipsePreferences getProjectNode(String nodeQualifier, IProject project) {
IScopeContext context = new ProjectScope(project);
IEclipsePreferences node = context.getNode(nodeQualifier);
return node;
}
use of org.eclipse.core.resources.ProjectScope in project xtext-eclipse by eclipse.
the class JavaProjectSetupUtil method setUnixLineEndings.
public static void setUnixLineEndings(IProject project) {
IEclipsePreferences prefs = new ProjectScope(project).getNode(Platform.PI_RUNTIME);
prefs.put(Platform.PREF_LINE_SEPARATOR, "\n");
try {
prefs.flush();
} catch (BackingStoreException e) {
throw new RuntimeException(e);
}
}
Aggregations