Exemplo n.º 1
0
 public boolean jumpTo(int lineNo, int column) {
   Debug.log(6, "jumpTo: " + lineNo + "," + column);
   try {
     int off = getLineStartOffset(lineNo - 1) + column - 1;
     int lineCount = getDocument().getDefaultRootElement().getElementCount();
     if (lineNo < lineCount) {
       int nextLine = getLineStartOffset(lineNo);
       if (off >= nextLine) {
         off = nextLine - 1;
       }
     }
     if (off >= 0) {
       setCaretPosition(off);
     }
   } catch (BadLocationException ex) {
     jumpTo(lineNo);
     return false;
   }
   return true;
 }