public TextLocation findWordsRightEdge(TextLocation location) { for (int i = location.toIndex(getLines()); i <= text.length() - 1; i++) { if (i == 0) i = 1; if (isAtEndOfWord(i)) return TextLocation.fromIndex(getLines(), i); } return getEndLocation(); }
public synchronized void setText(String newText) { if (newText == null) newText = ""; if (newText.length() == text.length() && newText.equals(getText())) return; text = new StringBuffer(newText); clearCache(); setCaretLocation(getEndLocation()); }
public TextLocation getEndLocation() { return TextLocation.fromIndex(getLines(), text.length()); }
protected TextLocation findNextWordSkippingSpacesOrNewLines(TextLocation startLocation) { for (int i = startLocation.toIndex(getLines()); i <= text.length() - 1; i++) { if (isAtStartOfWord(i)) return TextLocation.fromIndex(getLines(), i); } return getEndLocation(); }