private boolean isLineTooLong(IDocument document, int line)
        throws BadLocationException
    {
        String lineContents = getLine(document, line);
        return calculateDisplayedWidth(lineContents) > getMargin();
    }
Returns <code>true</code> if the line is too long, <code>false</code> otherwise.
plugins/org.jkiss.dbeaver.ui.editors.sql/src/org/jkiss/dbeaver/ui/editors/sql/indent/SQLCommentAutoIndentStrategy.java