void (@NotNull CaretEvent e) { Caret caret = e.getCaret(); if (caret != myEditor.getCaretModel().getPrimaryCaret()) { return; } int dot = caret.getOffset(); int mark = caret.getLeadSelectionOffset(); if (myCaretPos != dot) { ThreadingAssertions.assertEventDispatchThread(); firePropertyChange(ACCESSIBLE_CARET_PROPERTY, Integer.valueOf(myCaretPos), Integer.valueOf(dot)); myCaretPos = dot; } if (mark != dot) { ThreadingAssertions.assertEventDispatchThread(); firePropertyChange(ACCESSIBLE_SELECTION_PROPERTY, null, getSelectedText()); } }