int (int line) { int startOffset = myDocument.getLineStartOffset(line); int endOffset = myDocument.getLineEndOffset(line); return containsWhitespacesOnly(myDocument.getCharsSequence(), startOffset, endOffset) ? getMaxIndentChars(line): 0; }