Search in sources :

Example 1 with ForwardingDocumentProvider

use of org.eclipse.ui.editors.text.ForwardingDocumentProvider in project eclipse.platform.text by eclipse.

the class AbstractDecoratedTextEditor method setDocumentProvider.

/*
	 * If there is no explicit document provider set, the implicit one is
	 * re-initialized based on the given editor input.
	 *
	 * @see org.eclipse.ui.texteditor.AbstractTextEditor#setDocumentProvider(org.eclipse.ui.IEditorInput)
	 */
@Override
protected void setDocumentProvider(IEditorInput input) {
    fImplicitDocumentProvider = DocumentProviderRegistry.getDefault().getDocumentProvider(input);
    IDocumentProvider provider = super.getDocumentProvider();
    if (provider instanceof ForwardingDocumentProvider) {
        ForwardingDocumentProvider forwarder = (ForwardingDocumentProvider) provider;
        forwarder.setParentProvider(fImplicitDocumentProvider);
    }
}
Also used : ForwardingDocumentProvider(org.eclipse.ui.editors.text.ForwardingDocumentProvider)

Example 2 with ForwardingDocumentProvider

use of org.eclipse.ui.editors.text.ForwardingDocumentProvider 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()));
}
Also used : SourceViewerConfiguration(org.eclipse.jface.text.source.SourceViewerConfiguration) ForwardingDocumentProvider(org.eclipse.ui.editors.text.ForwardingDocumentProvider) ChainedPreferenceStore(org.eclipse.ui.texteditor.ChainedPreferenceStore) IPreferenceStore(org.eclipse.jface.preference.IPreferenceStore) ColorManager(org.eclipse.titan.designer.editors.ColorManager) TextFileDocumentProvider(org.eclipse.ui.editors.text.TextFileDocumentProvider)

Example 3 with ForwardingDocumentProvider

use of org.eclipse.ui.editors.text.ForwardingDocumentProvider 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);
}
Also used : SourceViewerConfiguration(org.eclipse.jface.text.source.SourceViewerConfiguration) ForwardingDocumentProvider(org.eclipse.ui.editors.text.ForwardingDocumentProvider) ChainedPreferenceStore(org.eclipse.ui.texteditor.ChainedPreferenceStore) IPreferenceStore(org.eclipse.jface.preference.IPreferenceStore) ColorManager(org.eclipse.titan.designer.editors.ColorManager) TextFileDocumentProvider(org.eclipse.ui.editors.text.TextFileDocumentProvider)

Example 4 with ForwardingDocumentProvider

use of org.eclipse.ui.editors.text.ForwardingDocumentProvider 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);
}
Also used : SourceViewerConfiguration(org.eclipse.jface.text.source.SourceViewerConfiguration) ForwardingDocumentProvider(org.eclipse.ui.editors.text.ForwardingDocumentProvider) ChainedPreferenceStore(org.eclipse.ui.texteditor.ChainedPreferenceStore) IPreferenceStore(org.eclipse.jface.preference.IPreferenceStore) ColorManager(org.eclipse.titan.designer.editors.ColorManager) TextFileDocumentProvider(org.eclipse.ui.editors.text.TextFileDocumentProvider)

Example 5 with ForwardingDocumentProvider

use of org.eclipse.ui.editors.text.ForwardingDocumentProvider 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);
}
Also used : SourceViewerConfiguration(org.eclipse.jface.text.source.SourceViewerConfiguration) ForwardingDocumentProvider(org.eclipse.ui.editors.text.ForwardingDocumentProvider) ChainedPreferenceStore(org.eclipse.ui.texteditor.ChainedPreferenceStore) IPreferenceStore(org.eclipse.jface.preference.IPreferenceStore) ColorManager(org.eclipse.titan.designer.editors.ColorManager) TextFileDocumentProvider(org.eclipse.ui.editors.text.TextFileDocumentProvider)

Aggregations

ForwardingDocumentProvider (org.eclipse.ui.editors.text.ForwardingDocumentProvider)5 IPreferenceStore (org.eclipse.jface.preference.IPreferenceStore)4 SourceViewerConfiguration (org.eclipse.jface.text.source.SourceViewerConfiguration)4 ColorManager (org.eclipse.titan.designer.editors.ColorManager)4 TextFileDocumentProvider (org.eclipse.ui.editors.text.TextFileDocumentProvider)4 ChainedPreferenceStore (org.eclipse.ui.texteditor.ChainedPreferenceStore)4