use of org.eclipse.core.resources.ProjectScope in project webtools.sourceediting by eclipse.
the class SyntaxValidator method getExcludedElementNames.
private Set getExcludedElementNames(IProject project) {
IScopeContext[] fLookupOrder = new IScopeContext[] { new InstanceScope(), new DefaultScope() };
if (project != null) {
ProjectScope projectScope = new ProjectScope(project);
if (projectScope.getNode(HTMLCorePlugin.getDefault().getBundle().getSymbolicName()).getBoolean(HTMLCorePreferenceNames.USE_PROJECT_SETTINGS, false))
fLookupOrder = new IScopeContext[] { projectScope, new InstanceScope(), new DefaultScope() };
}
Set result = new HashSet();
if (fPreferenceService.getBoolean(HTMLCorePlugin.getDefault().getBundle().getSymbolicName(), HTMLCorePreferenceNames.IGNORE_ELEMENT_NAMES, HTMLCorePreferenceNames.IGNORE_ELEMENT_NAMES_DEFAULT, fLookupOrder)) {
String ignoreList = fPreferenceService.getString(HTMLCorePlugin.getDefault().getBundle().getSymbolicName(), HTMLCorePreferenceNames.ELEMENT_NAMES_TO_IGNORE, HTMLCorePreferenceNames.ELEMENT_NAMES_TO_IGNORE_DEFAULT, fLookupOrder);
if (ignoreList.trim().length() == 0)
return result;
// $NON-NLS-1$
String[] names = ignoreList.split(",");
for (int i = 0; names != null && i < names.length; i++) {
String name = names[i] == null ? null : names[i].trim();
if (name != null && name.length() > 0)
result.add(name.toLowerCase());
}
}
return result;
}
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);
}
}
use of org.eclipse.core.resources.ProjectScope in project xtext-eclipse by eclipse.
the class BinFolderConfigurator method compileToBin.
/**
* Read a setting from the project scope (higher prio) or the instance scope (lower prio) to decide if Eclipse should use its own output
* dir or compile to the maven standard output directories.
*
* Defaults to {@code false}.
*/
private boolean compileToBin(IProject project) {
String pluginId = "org.eclipse.xtext.m2e";
String key = "compileToBin";
ProjectScope projectScope = new ProjectScope(project);
IEclipsePreferences projectPreferences = projectScope.getNode(pluginId);
String value = projectPreferences.get(key, null);
if (value != null) {
return "true".equals(value);
}
IEclipsePreferences instancePreferences = InstanceScope.INSTANCE.getNode(pluginId);
return "true".equals(instancePreferences.get(key, "false"));
}
use of org.eclipse.core.resources.ProjectScope 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);
}
use of org.eclipse.core.resources.ProjectScope in project jbosstools-hibernate by jbosstools.
the class ProjectDefaultConfigurationChange method perform.
/* (non-Javadoc)
* @see org.eclipse.ltk.core.refactoring.Change#perform(org.eclipse.core.runtime.IProgressMonitor)
*/
@Override
public Change perform(IProgressMonitor pm) throws CoreException {
try {
IScopeContext scope = new ProjectScope(project);
Preferences node = scope.getNode(HibernatePropertiesConstants.HIBERNATE_CONSOLE_NODE);
String oldName = node.get(HibernatePropertiesConstants.DEFAULT_CONFIGURATION, null);
node.putBoolean(HibernatePropertiesConstants.HIBERNATE3_ENABLED, true);
node.put(HibernatePropertiesConstants.DEFAULT_CONFIGURATION, newConsoleName);
node.flush();
return new ProjectDefaultConfigurationChange(project, oldName);
} catch (BackingStoreException e) {
HibernateConsolePlugin.openError(new Shell(), Messages.ProjectDefaultConfigurationChange_error_title, e.getLocalizedMessage(), e, HibernateConsolePlugin.PERFORM_SYNC_EXEC);
return new NullChange();
}
}
Aggregations