@Override protected SourceViewer createSourceViewer(Composite parent, int textOrientation) { SourceViewer sourceViewer; if (getSite() != null) { CompilationUnitEditorAdapter editor= new CompilationUnitEditorAdapter(textOrientation); editor.createPartControl(parent); ISourceViewer iSourceViewer= editor.getViewer(); Assert.isTrue(iSourceViewer instanceof SourceViewer); sourceViewer= (SourceViewer)iSourceViewer; if (fEditor == null) fEditor= new HashMap<>(3); fEditor.put(sourceViewer, editor); } else sourceViewer= super.createSourceViewer(parent, textOrientation); if (fSourceViewer == null) fSourceViewer= new ArrayList<>(); fSourceViewer.add(sourceViewer); return sourceViewer; }
@Override protected SourceViewer createSourceViewer(Composite parent, int textOrientation) { SourceViewer sourceViewer; if (getSite() != null) { CompilationUnitEditorAdapter editor= new CompilationUnitEditorAdapter(textOrientation); editor.createPartControl(parent); ISourceViewer iSourceViewer= editor.getViewer(); Assert.isTrue(iSourceViewer instanceof SourceViewer); sourceViewer= (SourceViewer)iSourceViewer; if (fEditor == null) fEditor= new HashMap<>(3); fEditor.put(sourceViewer, editor); } else sourceViewer= super.createSourceViewer(parent, textOrientation); if (fSourceViewer == null) fSourceViewer= new ArrayList<>(); fSourceViewer.add(sourceViewer); return sourceViewer; }
@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); }
private MergeSourceViewer createPart(Composite parent) { final MergeSourceViewer viewer = new MergeSourceViewer( createSourceViewer(parent, getDirection()), getResourceBundle(), getCompareConfiguration().getContainer()); final StyledText te= viewer.getSourceViewer().getTextWidget();