/** * Sets the document this text area is editing. * * @param document The document */ public void setDocument(SyntaxDocument document) { if (this.document == document) return; if (this.document != null) this.document.removeDocumentListener(documentHandler); this.document = document; document.addDocumentListener(documentHandler); select(0, 0); updateScrollBars(); painter.repaint(); }
/** Moves the mark to the caret position. */ public final void selectNone() { select(getCaretPosition(), getCaretPosition()); }
/** Selects all text in the document. */ public final void selectAll() { select(0, getDocumentLength()); }
/** * Sets the caret position. The new selection will consist of the caret position only (hence no * text will be selected) * * @param caret The caret position * @see #select(int,int) */ public final void setCaretPosition(int caret) { select(caret, caret); }
/** * Sets the selection end. The new selection will be the old selection start and the bew selection * end. * * @param selectionEnd The selection end * @see #select(int,int) */ public final void setSelectionEnd(int selectionEnd) { select(selectionStart, selectionEnd); }