use of org.eclipse.core.runtime.preferences.ConfigurationScope in project xtext-eclipse by eclipse.
the class PreferenceStoreAccessTest method testChainedPreferenceStore.
@SuppressWarnings("deprecation")
@Test
public void testChainedPreferenceStore() {
ScopedPreferenceStore configurationStore = new ScopedPreferenceStore(new ConfigurationScope(), LANGUAGE_ID);
configurationStore.setValue("someInt", 12);
configurationStore.setValue("anotherInt", 12);
configurationStore.setDefault("thirdInt", 12);
ScopedPreferenceStore instanceStore = new ScopedPreferenceStore(new InstanceScope(), LANGUAGE_ID);
instanceStore.setValue("someInt", 13);
instanceStore.setDefault("anotherInt", 13);
ChainedPreferenceStore chainedStore = new ChainedPreferenceStore(new IPreferenceStore[] { instanceStore, configurationStore });
assertEquals(13, chainedStore.getInt("someInt"));
assertEquals(13, chainedStore.getInt("anotherInt"));
assertEquals(12, chainedStore.getInt("thirdInt"));
}
Aggregations