boolean () { if (!myHostMarker.isValid() || !myDocumentWindow.isValid()) return false; int startOffset = getStartOffset(); int endOffset = getEndOffset(); return startOffset <= endOffset && endOffset <= myDocumentWindow.getTextLength(); }