use of org.eclipse.core.runtime.preferences.IScopeContext 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.IScopeContext 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.IScopeContext in project liferay-ide by liferay.
the class AbstractValidationSettingsPage method storeValues.
/**
* (non-Javadoc)
*
* @see org.eclipse.wst.sse.ui.internal.preferences.ui.AbstractSettingsPage#
* storeValues()
*/
protected void storeValues() {
if ((_fCombos == null) || (_fCombos.size() == 0)) {
return;
}
Iterator it = _fCombos.iterator();
IScopeContext[] contexts = createPreferenceScopes();
while (it.hasNext()) {
ComboData data = (ComboData) ((Combo) it.next()).getData();
if (data.getKey() != null) {
contexts[0].getNode(getPreferenceNodeQualifier()).putInt(data.getKey(), data.getSeverity());
}
}
for (int i = 0; i < contexts.length; i++) {
try {
contexts[i].getNode(getPreferenceNodeQualifier()).flush();
} catch (BackingStoreException bse) {
}
}
}
use of org.eclipse.core.runtime.preferences.IScopeContext in project liferay-ide by liferay.
the class ProjectProviderDefaultValueService method compute.
@Override
protected String compute() {
String retval = "ant";
IScopeContext[] prefContexts = { DefaultScope.INSTANCE, InstanceScope.INSTANCE };
String defaultProjectBuildType = Platform.getPreferencesService().getString(ProjectCore.PLUGIN_ID, ProjectCore.PREF_DEFAULT_PLUGIN_PROJECT_BUILD_TYPE_OPTION, null, prefContexts);
if (defaultProjectBuildType == null) {
return retval;
}
ILiferayProjectProvider provider = LiferayCore.getProvider(defaultProjectBuildType);
if (provider != null) {
retval = defaultProjectBuildType;
}
return retval;
}
use of org.eclipse.core.runtime.preferences.IScopeContext in project liferay-ide by liferay.
the class FragmentProjectProviderDefaultValueService method compute.
@Override
protected String compute() {
String retval = "gradle-module-fragment";
final IScopeContext[] prefContexts = { DefaultScope.INSTANCE, InstanceScope.INSTANCE };
final String defaultProjectBuildType = Platform.getPreferencesService().getString(ProjectCore.PLUGIN_ID, ProjectCore.PREF_DEFAULT_MODULE_FRAGMENT_PROJECT_BUILD_TYPE_OPTION, null, prefContexts);
if (defaultProjectBuildType != null) {
final ILiferayProjectProvider provider = LiferayCore.getProvider(defaultProjectBuildType);
if (provider != null) {
retval = defaultProjectBuildType;
}
}
return retval;
}
Aggregations