Search in sources :

Example 1 with CompoundXtextEditorCallback

use of org.eclipse.xtext.ui.editor.CompoundXtextEditorCallback in project xtext-eclipse by eclipse.

the class DefaultMergeViewer method createSourceViewer.

@Override
protected SourceViewer createSourceViewer(Composite parent, int textOrientation) {
    if (getSite() != null) {
        if (sourceViewerEditorMap == null) {
            sourceViewerEditorMap = Maps.newHashMapWithExpectedSize(3);
        }
        DefaultMergeEditor mergeEditor = createMergeEditor();
        mergeEditor.setXtextEditorCallback(new CompoundXtextEditorCallback(null));
        mergeEditor.setTextOrientation(textOrientation);
        mergeEditor.setInternalSite(getSite());
        mergeEditor.createPartControl(parent);
        SourceViewer internalSourceViewer = (SourceViewer) mergeEditor.getInternalSourceViewer();
        sourceViewerEditorMap.put(internalSourceViewer, mergeEditor);
        return internalSourceViewer;
    }
    return super.createSourceViewer(parent, textOrientation);
}
Also used : ISourceViewer(org.eclipse.jface.text.source.ISourceViewer) SourceViewer(org.eclipse.jface.text.source.SourceViewer) CompoundXtextEditorCallback(org.eclipse.xtext.ui.editor.CompoundXtextEditorCallback)

Aggregations

ISourceViewer (org.eclipse.jface.text.source.ISourceViewer)1 SourceViewer (org.eclipse.jface.text.source.SourceViewer)1 CompoundXtextEditorCallback (org.eclipse.xtext.ui.editor.CompoundXtextEditorCallback)1