@Override protected void installTabsToSpacesConverter() { ISourceViewer sourceViewer = getSourceViewer(); SourceViewerConfiguration config = getSourceViewerConfiguration(); if (config != null && sourceViewer instanceof ITextViewerExtension7) { int tabWidth = config.getTabWidth(sourceViewer); TabsToSpacesConverter tabToSpacesConverter = new TabsToSpacesConverter(); tabToSpacesConverter.setNumberOfSpacesPerTab(tabWidth); IDocumentProvider provider = getDocumentProvider(); if (provider instanceof ICompilationUnitDocumentProvider) { ICompilationUnitDocumentProvider cup = (ICompilationUnitDocumentProvider) provider; tabToSpacesConverter.setLineTracker(cup.createLineTracker(getEditorInput())); } else tabToSpacesConverter.setLineTracker(new DefaultLineTracker()); ((ITextViewerExtension7) sourceViewer).setTabsToSpacesConverter(tabToSpacesConverter); updateIndentPrefixes(); } }
@Override protected void installTabsToSpacesConverter() { ISourceViewer sourceViewer= getSourceViewer(); SourceViewerConfiguration config= getSourceViewerConfiguration(); if (config != null && sourceViewer instanceof ITextViewerExtension7) { int tabWidth= config.getTabWidth(sourceViewer); TabsToSpacesConverter tabToSpacesConverter= new TabsToSpacesConverter(); tabToSpacesConverter.setNumberOfSpacesPerTab(tabWidth); IDocumentProvider provider= getDocumentProvider(); if (provider instanceof ICompilationUnitDocumentProvider) { ICompilationUnitDocumentProvider cup= (ICompilationUnitDocumentProvider) provider; tabToSpacesConverter.setLineTracker(cup.createLineTracker(getEditorInput())); } else tabToSpacesConverter.setLineTracker(new DefaultLineTracker()); ((ITextViewerExtension7)sourceViewer).setTabsToSpacesConverter(tabToSpacesConverter); updateIndentPrefixes(); } }