use of org.eclipse.ui.texteditor.ChainedPreferenceStore in project eclipse.platform.text by eclipse.
the class ChainedPreferenceStoreTest method testChainedStore2.
/**
* Third case where the initial implementation used to have an assertion which would fail in this case
*/
@Test
public void testChainedStore2() {
IPreferenceStore store1 = new PreferenceStore();
IPreferenceStore store2 = new PreferenceStore();
IPreferenceStore chainedStore = new ChainedPreferenceStore(new IPreferenceStore[] { store1, store2 });
store1.setValue(PROPERTY, VALUE);
chainedStore.addPropertyChangeListener(fPropertyChangeListener);
// simulated change with newValue == null
store1.firePropertyChangeEvent(PROPERTY, DEFAULT_VALUE, null);
chainedStore.removePropertyChangeListener(fPropertyChangeListener);
assertEquals(1, fEvents.size());
PropertyChangeEvent event = fEvents.get(0);
assertEquals(store1, event.getSource());
assertEquals(PROPERTY, event.getProperty());
assertEquals(DEFAULT_VALUE, event.getOldValue());
assertEquals(null, event.getNewValue());
}
use of org.eclipse.ui.texteditor.ChainedPreferenceStore in project webtools.sourceediting by eclipse.
the class StructuredTextViewerConfiguration method createCombinedPreferenceStore.
/**
* Create a preference store that combines the source editor preferences
* with the base editor's preferences.
*
* @return IPreferenceStore
*/
private IPreferenceStore createCombinedPreferenceStore() {
IPreferenceStore sseEditorPrefs = SSEUIPlugin.getDefault().getPreferenceStore();
IPreferenceStore baseEditorPrefs = EditorsUI.getPreferenceStore();
return new ChainedPreferenceStore(new IPreferenceStore[] { sseEditorPrefs, baseEditorPrefs });
}
use of org.eclipse.ui.texteditor.ChainedPreferenceStore in project xtext-xtend by eclipse.
the class XtendPreferenceStoreAccess method getPreferenceStore.
@SuppressWarnings("all")
@Override
public IPreferenceStore getPreferenceStore() {
IPreferenceStore store = super.getPreferenceStore();
FixedScopedPreferenceStore jdtStore = new FixedScopedPreferenceStore(new InstanceScope(), JavaCore.PLUGIN_ID);
jdtStore.setSearchContexts(new IScopeContext[] { new InstanceScope(), new ConfigurationScope() });
return new ChainedPreferenceStore(new IPreferenceStore[] { store, jdtStore, PreferenceConstants.getPreferenceStore() });
}
use of org.eclipse.ui.texteditor.ChainedPreferenceStore in project titan.EclipsePlug-ins by eclipse.
the class TTCN3Editor method initializeEditor.
/**
* Initialize the editor
* <p>
* This function is called by the constructor TTCN3Editor() before its first line of its body!
*/
@Override
protected void initializeEditor() {
super.initializeEditor();
IPreferenceStore[] stores = { getPreferenceStore(), Activator.getDefault().getPreferenceStore() };
setPreferenceStore(new ChainedPreferenceStore(stores));
colorManager = new ColorManager();
configuration = new Configuration(colorManager, this);
setSourceViewerConfiguration(configuration);
ForwardingDocumentProvider forwardingProvider = new ForwardingDocumentProvider(PartitionScanner.TTCN3_PARTITIONING, new DocumentSetupParticipant(this), new TextFileDocumentProvider());
setDocumentProvider(forwardingProvider);
setEditorContextMenuId(EDITOR_CONTEXT);
HeadlessStorage.setTabWidth(configuration.getTabWidth(getSourceViewer()));
}
use of org.eclipse.ui.texteditor.ChainedPreferenceStore in project titan.EclipsePlug-ins by eclipse.
the class TTCNPPEditor method initializeEditor.
@Override
protected void initializeEditor() {
super.initializeEditor();
IPreferenceStore[] stores = { getPreferenceStore(), Activator.getDefault().getPreferenceStore() };
setPreferenceStore(new ChainedPreferenceStore(stores));
colorManager = new ColorManager();
configuration = new Configuration(colorManager, this);
setSourceViewerConfiguration(configuration);
DocumentSetupParticipant participant = new DocumentSetupParticipant(this);
ForwardingDocumentProvider forwardingProvider = new ForwardingDocumentProvider(PartitionScanner.TTCNPP_PARTITIONING, participant, new TextFileDocumentProvider());
setDocumentProvider(forwardingProvider);
setEditorContextMenuId(EDITOR_CONTEXT);
}
Aggregations