use of org.eclipse.jface.text.TabsToSpacesConverter in project eclipse.platform.text by eclipse.
the class AbstractTextEditor method installTabsToSpacesConverter.
// ---- Tabs to spaces conversion support ------------------
/**
* Installs a tabs to spaces converter.
*
* <p>Subclasses may extend or override this method.</p>
*
* @since 3.3
*/
protected void installTabsToSpacesConverter() {
SourceViewerConfiguration config = getSourceViewerConfiguration();
if (config != null && fSourceViewer instanceof ITextViewerExtension7) {
int tabWidth = config.getTabWidth(fSourceViewer);
TabsToSpacesConverter tabToSpacesConverter = new TabsToSpacesConverter();
tabToSpacesConverter.setLineTracker(new DefaultLineTracker());
tabToSpacesConverter.setNumberOfSpacesPerTab(tabWidth);
((ITextViewerExtension7) fSourceViewer).setTabsToSpacesConverter(tabToSpacesConverter);
updateIndentPrefixes();
}
}
use of org.eclipse.jface.text.TabsToSpacesConverter in project linuxtools by eclipse.
the class SpecfileConfiguration method getAutoEditStrategies.
@Override
public IAutoEditStrategy[] getAutoEditStrategies(ISourceViewer sourceViewer, String contentType) {
if (isTabConversionEnabled()) {
TabsToSpacesConverter tabsConverter = new TabsToSpacesConverter();
tabsConverter.setLineTracker(new DefaultLineTracker());
tabsConverter.setNumberOfSpacesPerTab(getTabSize());
return new IAutoEditStrategy[] { tabsConverter };
}
return null;
}
Aggregations