Exemplo n.º 1
0
  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();
  }
Exemplo n.º 2
0
  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());
  }
Exemplo n.º 3
0
 public TextLocation getEndLocation() {
   return TextLocation.fromIndex(getLines(), text.length());
 }
Exemplo n.º 4
0
 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();
 }