void (boolean mode) { ThreadingAssertions.assertEventDispatchThread(); boolean oldValue = myIsInsertMode; myIsInsertMode = mode; myPropertyChangeSupport.firePropertyChange(EditorEx.PROP_INSERT_MODE, oldValue, mode); //Repaint the caret line by moving caret to the same place LogicalPosition caretPosition = getCaretModel().getLogicalPosition(); getCaretModel().moveToLogicalPosition(caretPosition); }