use of org.eclipse.ui.texteditor.ChainedPreferenceStore in project webtools.sourceediting by eclipse.
the class AnnotationHoverProcessor method getPreferenceStore.
/**
* Retreives the preference store If no preference store is currently
* stored, retreive the appropriate preference store
*/
private IPreferenceStore getPreferenceStore() {
if (fPreferenceStore == null) {
IPreferenceStore sseEditorPrefs = SSEUIPlugin.getDefault().getPreferenceStore();
IPreferenceStore baseEditorPrefs = EditorsUI.getPreferenceStore();
fPreferenceStore = new ChainedPreferenceStore(new IPreferenceStore[] { sseEditorPrefs, baseEditorPrefs });
}
return fPreferenceStore;
}
use of org.eclipse.ui.texteditor.ChainedPreferenceStore in project xtext-xtend by eclipse.
the class XtendPreferenceStoreAccess method getContextPreferenceStore.
@SuppressWarnings("all")
@Override
public IPreferenceStore getContextPreferenceStore(Object context) {
IProject project = getProject(context);
if (project == null)
return getPreferenceStore();
IPreferenceStore store = super.getContextPreferenceStore(context);
ProjectScope projectScope = new ProjectScope(project);
FixedScopedPreferenceStore jdtStore = new FixedScopedPreferenceStore(projectScope, JavaCore.PLUGIN_ID);
jdtStore.setSearchContexts(new IScopeContext[] { projectScope, new InstanceScope(), new ConfigurationScope() });
return new ChainedPreferenceStore(new IPreferenceStore[] { store, jdtStore, PreferenceConstants.getPreferenceStore() });
}
use of org.eclipse.ui.texteditor.ChainedPreferenceStore in project xtext-eclipse by eclipse.
the class PreferenceStoreAccessImpl method getPreferenceStore.
@Override
public IPreferenceStore getPreferenceStore() {
lazyInitialize();
Activator activator = Activator.getDefault();
if (activator != null)
return new ChainedPreferenceStore(new IPreferenceStore[] { getWritablePreferenceStore(), activator.getPreferenceStore(), EditorsUI.getPreferenceStore() });
return new ChainedPreferenceStore(new IPreferenceStore[] { getWritablePreferenceStore(), EditorsUI.getPreferenceStore() });
}
use of org.eclipse.ui.texteditor.ChainedPreferenceStore in project xtext-eclipse by eclipse.
the class PreferenceStoreAccessImpl method getContextPreferenceStore.
@Override
public IPreferenceStore getContextPreferenceStore(Object context) {
lazyInitialize();
// may be null on shutdown
Activator activator = Activator.getDefault();
if (activator != null)
return new ChainedPreferenceStore(new IPreferenceStore[] { getWritablePreferenceStore(context), activator.getPreferenceStore(), EditorsUI.getPreferenceStore() });
return new ChainedPreferenceStore(new IPreferenceStore[] { getWritablePreferenceStore(context), EditorsUI.getPreferenceStore() });
}
use of org.eclipse.ui.texteditor.ChainedPreferenceStore in project eclipse.platform.text by eclipse.
the class ChainedPreferenceStoreTest method testChainedStore3.
/**
* Case where the initial implementation used to throw an IAE
*/
@Test
public void testChainedStore3() {
IPreferenceStore store1 = new PreferenceStore();
IPreferenceStore store2 = new PreferenceStore();
IPreferenceStore chainedStore = new ChainedPreferenceStore(new IPreferenceStore[] { store1, store2 });
store2.setDefault(PROPERTY, DEFAULT_VALUE);
chainedStore.addPropertyChangeListener(fPropertyChangeListener);
// simulated removal with oldValue == null
store1.firePropertyChangeEvent(PROPERTY, null, null);
chainedStore.removePropertyChangeListener(fPropertyChangeListener);
assertEquals(1, fEvents.size());
PropertyChangeEvent event = fEvents.get(0);
assertEquals(chainedStore, event.getSource());
assertEquals(PROPERTY, event.getProperty());
assertEquals(null, event.getOldValue());
assertEquals(DEFAULT_VALUE, event.getNewValue());
}
Aggregations