use of org.eclipse.core.runtime.preferences.ConfigurationScope in project xtext-eclipse by eclipse.
the class PreferenceStoreAccessTest method testScope.
@SuppressWarnings("deprecation")
@Test
public void testScope() {
ScopedPreferenceStore scopedPreferenceStore = new ScopedPreferenceStore(new ConfigurationScope(), "org");
assertFalse("partial keys are not supported", scopedPreferenceStore.getBoolean("xtext.MyLanguage.someBoolean"));
}
use of org.eclipse.core.runtime.preferences.ConfigurationScope in project xtext-eclipse by eclipse.
the class AbstractPreferencePage method handleUseProjectSettings.
/**
* Switches the search scope of the preference store to use [Project, Instance, Configuration] if values are project
* specific, and [Instance, Configuration] otherwise. This implementation requires that the given preference store
* is based on the Project preference store when the page is used as a Properties page. (This is done in
* {@link #doGetPreferenceStore()}).
*/
@SuppressWarnings("deprecation")
private void handleUseProjectSettings() {
// Note: uses the pre Eclipse 3.6 way of specifying search scopes (deprecated since 3.6)
boolean isUseProjectSettings = useProjectSettingsButton.getSelection();
link.setEnabled(!isUseProjectSettings);
if (!isUseProjectSettings) {
((FixedScopedPreferenceStore) getPreferenceStore()).setSearchContexts(new IScopeContext[] { new InstanceScope(), new ConfigurationScope() });
} else {
((FixedScopedPreferenceStore) getPreferenceStore()).setSearchContexts(new IScopeContext[] { new ProjectScope(currentProject()), new InstanceScope(), new ConfigurationScope() });
setProjectSpecificValues();
}
updateFieldEditors(isUseProjectSettings);
}
use of org.eclipse.core.runtime.preferences.ConfigurationScope in project xtext-eclipse by eclipse.
the class PreferenceStoreAccessImpl method getWritablePreferenceStore.
@Override
@SuppressWarnings("deprecation")
public IPreferenceStore getWritablePreferenceStore(Object context) {
lazyInitialize();
IProject project = getProject(context);
if (project == null) {
return getWritablePreferenceStore();
}
ProjectScope projectScope = new ProjectScope(project);
FixedScopedPreferenceStore result = new FixedScopedPreferenceStore(projectScope, getQualifier());
result.setSearchContexts(new IScopeContext[] { projectScope, new InstanceScope(), new ConfigurationScope() });
return result;
}
use of org.eclipse.core.runtime.preferences.ConfigurationScope in project xtext-eclipse by eclipse.
the class PreferenceStoreAccessImpl method getWritablePreferenceStore.
@Override
@SuppressWarnings("deprecation")
public IPreferenceStore getWritablePreferenceStore() {
lazyInitialize();
FixedScopedPreferenceStore result = new FixedScopedPreferenceStore(new InstanceScope(), getQualifier());
result.setSearchContexts(new IScopeContext[] { new InstanceScope(), new ConfigurationScope() });
return result;
}
use of org.eclipse.core.runtime.preferences.ConfigurationScope in project polymap4-core by Polymap4.
the class PasswordProviderSelector method getDisabledModules.
protected HashSet getDisabledModules() {
IEclipsePreferences node = new ConfigurationScope().getNode(AuthPlugin.PI_AUTH);
String tmp = node.get(IStorageConstants.DISABLED_PROVIDERS_KEY, null);
if (tmp == null || tmp.length() == 0)
return null;
HashSet disabledModules = new HashSet();
// $NON-NLS-1$
String[] disabledProviders = tmp.split(",");
for (int i = 0; i < disabledProviders.length; i++) {
disabledModules.add(disabledProviders[i]);
}
return disabledModules;
}
Aggregations