use of org.eclipse.ui.texteditor.ChainedPreferenceStore in project titan.EclipsePlug-ins by eclipse.
the class ConfigTextEditor 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();
ForwardingDocumentProvider forwardingProvider = new ForwardingDocumentProvider(PartitionScanner.CONFIG_PARTITIONING, participant, new TextFileDocumentProvider());
setDocumentProvider(forwardingProvider);
setEditorContextMenuId(EDITOR_CONTEXT);
}
use of org.eclipse.ui.texteditor.ChainedPreferenceStore in project titan.EclipsePlug-ins by eclipse.
the class ASN1Editor 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.ASN1_PARTITIONING, participant, new TextFileDocumentProvider());
setDocumentProvider(forwardingProvider);
setEditorContextMenuId(EDITOR_CONTEXT);
}
use of org.eclipse.ui.texteditor.ChainedPreferenceStore 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