/** * Copies the text on the specified line into a segment. If the line * is invalid, the segment will contain a null string. * @param lineIndex The line */ public final void getLineText(int lineIndex, Segment segment) { int start = getLineStartOffset(lineIndex); getText(start,getLineEndOffset(lineIndex) - start - 1,segment); }
/** * Returns the text on the specified line. * @param lineIndex The line * @return The text, or null if the line is invalid */ public final String getLineText(int lineIndex) { int start = getLineStartOffset(lineIndex); return getText(start,getLineEndOffset(lineIndex) - start - 1); }
private void doTripleClick(MouseEvent evt, int line, int offset, int dot) { select(getLineStartOffset(line),getLineEndOffset(line)-1); } }
/** * Returns the offset where the selection ends on the specified * line. */ public int getSelectionEnd(int line) { if(line == selectionEndLine) return selectionEnd; else if(rectSelect) { Element map = document.getDefaultRootElement(); int end = selectionEnd - map.getElement(selectionEndLine) .getStartOffset(); Element lineElement = map.getElement(line); int lineStart = lineElement.getStartOffset(); int lineEnd = lineElement.getEndOffset() - 1; return Math.min(lineEnd,lineStart + end); } else return getLineEndOffset(line) - 1; }
int lastOfLine = textArea.getLineEndOffset( textArea.getCaretLine()) - 1; int lastVisibleLine = textArea.getFirstLine() lastVisibleLine -= (textArea.getElectricScroll() + 1); int lastVisible = textArea.getLineEndOffset(lastVisibleLine) - 1; int lastDocument = textArea.getDocumentLength();
int caretLineEnd = getLineEndOffset(getCaretLine()); if(caretLineEnd - caret <= str.length())