use of org.eclipse.core.resources.ProjectScope in project linuxtools by eclipse.
the class CreaterepoPropertyPage method createContents.
@Override
protected Control createContents(Composite parent) {
if (getElement() instanceof IResource) {
project = ((IResource) getElement()).getProject();
} else {
Object adapter = getElement().getAdapter(IResource.class);
if (adapter instanceof IResource) {
project = ((IResource) adapter).getProject();
}
}
setPreferenceStore(new ScopedPreferenceStore(new ProjectScope(project), Activator.PLUGIN_ID));
preferenceStore = getPreferenceStore();
return addContents(parent);
}
use of org.eclipse.core.resources.ProjectScope in project eclipse-integration-commons by spring-projects.
the class SpringCorePreferences method getEclipsePreferences.
private IEclipsePreferences getEclipsePreferences(IProject project, String qualifier) {
IScopeContext context = project != null ? new ProjectScope(project) : InstanceScope.INSTANCE;
IEclipsePreferences node = context.getNode(qualifier);
return node;
}
use of org.eclipse.core.resources.ProjectScope in project webtools.sourceediting by eclipse.
the class FragmentValidationTools method shouldValidateFragment.
/**
* @param resource
* @return whether to perform validation on a fragment, returning the
* project-specific preference only of project-specific values are
* enabled
*/
static boolean shouldValidateFragment(IResource resource) {
String qualifier = JSPCorePlugin.getDefault().getBundle().getSymbolicName();
IProject project = null;
if (resource.getType() == IResource.PROJECT) {
project = (IProject) resource;
} else {
project = resource.getProject();
}
if (project != null) {
IEclipsePreferences node = new ProjectScope(project).getNode(qualifier);
// first, check whether project specific settings are to be used
boolean useProjectSettings = node.getBoolean(JSPCorePreferenceNames.VALIDATION_USE_PROJECT_SETTINGS, false);
if (useProjectSettings) {
// only if so, return that value
return node.getBoolean(JSPCorePreferenceNames.VALIDATE_FRAGMENTS, true);
}
// if not, return the workspace value
}
return new InstanceScope().getNode(qualifier).getBoolean(JSPCorePreferenceNames.VALIDATE_FRAGMENTS, true);
}
use of org.eclipse.core.resources.ProjectScope in project webtools.sourceediting by eclipse.
the class JSPActionValidator method loadPreferences.
private void loadPreferences(IFile file) {
fScopes = new IScopeContext[] { new InstanceScope(), new DefaultScope() };
fPreferencesService = Platform.getPreferencesService();
if (file != null && file.isAccessible()) {
ProjectScope projectScope = new ProjectScope(file.getProject());
if (projectScope.getNode(PREFERENCE_NODE_QUALIFIER).getBoolean(JSPCorePreferenceNames.VALIDATION_USE_PROJECT_SETTINGS, false)) {
fScopes = new IScopeContext[] { projectScope, new InstanceScope(), new DefaultScope() };
}
}
fSeverityMissingRequiredAttribute = getMessageSeverity(JSPCorePreferenceNames.VALIDATION_ACTIONS_SEVERITY_MISSING_REQUIRED_ATTRIBUTE);
fSeverityNonEmptyInlineTag = getMessageSeverity(JSPCorePreferenceNames.VALIDATION_ACTIONS_SEVERITY_NON_EMPTY_INLINE_TAG);
fSeverityUnknownAttribute = getMessageSeverity(JSPCorePreferenceNames.VALIDATION_ACTIONS_SEVERITY_UNKNOWN_ATTRIBUTE);
fSeverityUnexpectedRuntimeExpression = getMessageSeverity(JSPCorePreferenceNames.VALIDATION_ACTIONS_SEVERITY_UNEXPECTED_RTEXPRVALUE);
}
use of org.eclipse.core.resources.ProjectScope in project webtools.sourceediting by eclipse.
the class JSPELValidator method loadPreferences.
private void loadPreferences(IFile file) {
fScopes = new IScopeContext[] { new InstanceScope(), new DefaultScope() };
fPreferencesService = Platform.getPreferencesService();
if (file != null && file.isAccessible()) {
ProjectScope projectScope = new ProjectScope(file.getProject());
if (projectScope.getNode(PREFERENCE_NODE_QUALIFIER).getBoolean(JSPCorePreferenceNames.VALIDATION_USE_PROJECT_SETTINGS, false)) {
fScopes = new IScopeContext[] { projectScope, new InstanceScope(), new DefaultScope() };
}
}
}
Aggregations