code: public void setOvertypeMode(boolean isOvertypeMode) {
          TextEditor.isOvertypeMode = isOvertypeMode;
          int pos = getCaretPosition();
          setCaret(isOvertypeMode() ? overtypeCaret : defaultCaret);
          setCaretPosition(pos);
      }
docs: Set the caret to use depending on overtype/insert mode
  
  @param isOvertypeMode the new mode; true = overtype