boolean (DocumentImpl initialDocument, int offset) { return caretOffset < initialDocument.getTextLength() && !StringUtil .isEmptyOrSpaces(initialDocument.getText(TextRange.create(offset, caretOffset))); }