use of org.eclipse.core.runtime.preferences.IPreferencesService in project erlide_eclipse by erlang.
the class DialyzerPreferences method getPLTPathsFromPreferences.
private static Collection<String> getPLTPathsFromPreferences() {
final IPreferencesService service = Platform.getPreferencesService();
final String key = "default_plt_files";
final String pluginId = "org.erlide.ui";
final String pltFilesString = service.getString(pluginId, key, "", null);
return DialyzerPreferences.getPltFiles(pltFilesString);
}
use of org.eclipse.core.runtime.preferences.IPreferencesService in project erlide_eclipse by erlang.
the class DialyzerPreferences method getAlternatePLTFileDirectoryFromPreferences.
public static String getAlternatePLTFileDirectoryFromPreferences() {
final IPreferencesService service = Platform.getPreferencesService();
final String key = "alternate_plt_file_directory";
final String pluginId = "org.erlide.ui";
return service.getString(pluginId, key, "", null);
}
use of org.eclipse.core.runtime.preferences.IPreferencesService in project webtools.sourceediting by eclipse.
the class WorkspaceTaskScanner method init.
private boolean init(IResource resource) {
IProject project = getProject(resource);
IPreferencesService preferencesService = Platform.getPreferencesService();
IScopeContext[] lookupOrder = new IScopeContext[] { new ProjectScope(project), new InstanceScope(), new DefaultScope() };
boolean proceed = preferencesService.getBoolean(TaskTagPreferenceKeys.TASK_TAG_NODE, TaskTagPreferenceKeys.TASK_TAG_ENABLE, false, lookupOrder);
if (Logger.DEBUG_TASKSPREFS) {
// $NON-NLS-1$ //$NON-NLS-2$
System.out.println(getClass().getName() + " scan of " + resource.getFullPath() + ":" + proceed);
}
if (proceed) {
String[] tags = StringUtils.unpack(preferencesService.getString(TaskTagPreferenceKeys.TASK_TAG_NODE, TaskTagPreferenceKeys.TASK_TAG_TAGS, null, lookupOrder));
String[] priorities = StringUtils.unpack(preferencesService.getString(TaskTagPreferenceKeys.TASK_TAG_NODE, TaskTagPreferenceKeys.TASK_TAG_PRIORITIES, null, lookupOrder));
String[] currentIgnoreContentTypeIDs = StringUtils.unpack(preferencesService.getString(TaskTagPreferenceKeys.TASK_TAG_NODE, TaskTagPreferenceKeys.TASK_TAG_CONTENTTYPES_IGNORED, null, lookupOrder));
if (Logger.DEBUG_TASKSPREFS) {
// $NON-NLS-1$
System.out.print(getClass().getName() + " tags: ");
for (int i = 0; i < tags.length; i++) {
if (i > 0) {
// $NON-NLS-1$
System.out.print(",");
}
System.out.print(tags[i]);
}
System.out.println();
// $NON-NLS-1$
System.out.print(getClass().getName() + " priorities: ");
for (int i = 0; i < priorities.length; i++) {
if (i > 0) {
// $NON-NLS-1$
System.out.print(",");
}
System.out.print(priorities[i]);
}
System.out.println();
// $NON-NLS-1$
System.out.print(getClass().getName() + " ignored content types: ");
for (int i = 0; i < currentIgnoreContentTypeIDs.length; i++) {
if (i > 0) {
// $NON-NLS-1$
System.out.print(",");
}
System.out.print(currentIgnoreContentTypeIDs[i]);
}
System.out.println();
}
fCurrentIgnoreContentTypes = new IContentType[currentIgnoreContentTypeIDs.length];
IContentTypeManager contentTypeManager = Platform.getContentTypeManager();
for (int i = 0; i < currentIgnoreContentTypeIDs.length; i++) {
fCurrentIgnoreContentTypes[i] = contentTypeManager.getContentType(currentIgnoreContentTypeIDs[i]);
}
int max = Math.min(tags.length, priorities.length);
fCurrentTaskTags = new TaskTag[max];
for (int i = 0; i < max; i++) {
int priority = TaskTag.PRIORITY_NORMAL;
try {
priority = Integer.parseInt(priorities[i]);
} catch (NumberFormatException e) {
// default to normal priority
}
fCurrentTaskTags[i] = new TaskTag(tags[i], priority);
}
}
return proceed;
}
use of org.eclipse.core.runtime.preferences.IPreferencesService in project webtools.sourceediting by eclipse.
the class PrefUtil method getProperty.
private static String getProperty(String property) {
// Importance order is:
// default-default < instanceScope < configurationScope < systemProperty
// < envVar
String value = null;
if (value == null) {
value = System.getenv(property);
}
if (value == null) {
value = System.getProperty(property);
}
if (value == null) {
IPreferencesService preferencesService = Platform.getPreferencesService();
String key = property;
if (property != null && property.startsWith(SSECorePlugin.ID)) {
// +1, include the "."
key = property.substring(SSECorePlugin.ID.length() + 1, property.length());
}
InstanceScope instance = new InstanceScope();
ConfigurationScope config = new ConfigurationScope();
Preferences instanceNode = instance.getNode(SSECorePlugin.ID);
Preferences configNode = config.getNode(SSECorePlugin.ID);
value = preferencesService.get(key, getDefault(property), new Preferences[] { configNode, instanceNode });
}
return value;
}
use of org.eclipse.core.runtime.preferences.IPreferencesService 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);
}
Aggregations