private static String getLine(IDocument document, int line)
        throws BadLocationException
    {
        IRegion region = document.getLineInformation(line);
        return document.get(region.getOffset(), region.getLength());
    }
Returns the displayed width of a string, taking in account the displayed tab width. The result can be compared
against the print margin.
plugins/org.jkiss.dbeaver.ui.editors.sql/src/org/jkiss/dbeaver/ui/editors/sql/indent/SQLCommentAutoIndentStrategy.java