use of org.eclipse.core.runtime.preferences.InstanceScope in project webtools.sourceediting by eclipse.
the class NewJSPWizard method applyLineDelimiter.
private String applyLineDelimiter(IFile file, String text) {
// $NON-NLS-1$
String lineDelimiter = Platform.getPreferencesService().getString(Platform.PI_RUNTIME, Platform.PREF_LINE_SEPARATOR, System.getProperty("line.separator"), new IScopeContext[] { new ProjectScope(file.getProject()), new InstanceScope() });
String convertedText = StringUtils.replace(text, "\r\n", "\n");
convertedText = StringUtils.replace(convertedText, "\r", "\n");
convertedText = StringUtils.replace(convertedText, "\n", lineDelimiter);
return convertedText;
}
use of org.eclipse.core.runtime.preferences.InstanceScope in project webtools.sourceediting by eclipse.
the class JSPCorePreferencesTest method testPluginSetPreferences.
/**
* Tests setting preference values by setting preference value to be a
* certain value, then getting the preference value to verify it was set.
*/
public void testPluginSetPreferences() {
IEclipsePreferences node = new InstanceScope().getNode(JSPCorePlugin.getDefault().getBundle().getSymbolicName());
pluginSetPreferenceBoolean(node, JSPCorePreferenceNames.VALIDATE_FRAGMENTS);
}
use of org.eclipse.core.runtime.preferences.InstanceScope in project webtools.sourceediting by eclipse.
the class TaskScanningJob method isEnabledOnProject.
private boolean isEnabledOnProject(IProject p) {
IPreferencesService preferencesService = Platform.getPreferencesService();
IScopeContext[] lookupOrder = new IScopeContext[] { new ProjectScope(p), new InstanceScope(), new DefaultScope() };
return preferencesService.getBoolean(TaskTagPreferenceKeys.TASK_TAG_NODE, TaskTagPreferenceKeys.TASK_TAG_ENABLE, false, lookupOrder);
}
use of org.eclipse.core.runtime.preferences.InstanceScope 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.runtime.preferences.InstanceScope in project webtools.servertools by eclipse.
the class ProfilerPreferences method setServerProfilerId.
/**
* Sets the profiler to use when profiling on server
* @param profilerId the id of the server profiler
*/
public void setServerProfilerId(String profilerId) {
Preferences node = new InstanceScope().getNode(PREF_PROFILER_QUALIFIER);
node.put(PREF_SELECTED_PROFILER, profilerId);
try {
node.flush();
} catch (BackingStoreException e) {
if (Trace.SEVERE) {
Trace.trace(Trace.STRING_SEVERE, "Could not save server profiler preference", e);
}
}
}
Aggregations