Package com.google.collide.shared.document

Examples of com.google.collide.shared.document.LineFinder.findLine()


    LineInfo newTop = lineFinder.findLine(getTop(), topLineNumber);

    int targetBottomLineNumber = newTop.number() + numLinesToShow - 1;
    LineInfo newBottom =
        lineFinder.findLine(getBottom(),
            Math.min(document.getLastLineNumber(), targetBottomLineNumber));

    setRange(newTop, newBottom);
  }
View Full Code Here


    Document document = editor.getDocument();
    LineFinder lineFinder = document.getLineFinder();
   
    LineInfo baseLineInfo =
        lineFinder.findLine(Math.min(selection.baseLineNumber, document.getLastLineNumber()));
    int baseColumn = LineUtils.rubberbandColumn(baseLineInfo.line(), selection.baseColumn);

    final LineInfo cursorLineInfo =
      lineFinder.findLine(Math.min(selection.cursorLineNumber, document.getLastLineNumber()));
    int cursorColumn = LineUtils.rubberbandColumn(cursorLineInfo.line(), selection.cursorColumn);
View Full Code Here

    LineInfo baseLineInfo =
        lineFinder.findLine(Math.min(selection.baseLineNumber, document.getLastLineNumber()));
    int baseColumn = LineUtils.rubberbandColumn(baseLineInfo.line(), selection.baseColumn);

    final LineInfo cursorLineInfo =
      lineFinder.findLine(Math.min(selection.cursorLineNumber, document.getLastLineNumber()));
    int cursorColumn = LineUtils.rubberbandColumn(cursorLineInfo.line(), selection.cursorColumn);
   
    editor.getSelection().setSelection(baseLineInfo, baseColumn, cursorLineInfo, cursorColumn);   

    // Defer to match editor's initially deferred scrolling
View Full Code Here

    for (int i = 0; i < errors.size(); i++) {
      CodeError error = errors.get(i);
      for (int j = error.getErrorStart().getLineNumber();
           j <= error.getErrorEnd().getLineNumber(); j++) {
        if (j >= topLineNumber && j <= bottomLineNumber) {
          lines.add(lineFinder.findLine(j).line());
        }
      }
    }
  }
View Full Code Here

    Preconditions.checkState(!allNodes.isEmpty());

    AnchorManager anchorManager = target.getAnchorManager();

    LineFinder lineFinder = target.getLineFinder();
    LineInfo cursor = lineFinder.findLine(0);
    int lastLineNumber = target.getLastLineNumber();

    for (int i = 0, size = allNodes.size(); i < size; ++i) {
      OutlineNode node = allNodes.get(i);
      int lineNumber = node.getLineNumber();
View Full Code Here

      if (lineNumber > lastLineNumber) {
        break;
      }

      // TODO: we should create method that reuses cursor object!
      cursor = lineFinder.findLine(cursor, lineNumber);

      maybeBindNode(node, cursor.line(), anchorManager);
    }
  }
View Full Code Here

      //               see comments in OutlineNodeBuilder.
      Line line = anchor.getLine();
      if (line.getText().contains(data.getName())) {
        editor.getFocusManager().focus();
        LineFinder lineFinder = editor.getDocument().getLineFinder();
        editor.scrollTo(lineFinder.findLine(line).number(), anchor.getColumn());
        return;
      }
    }
    // If we didn't find what we were looking for, then:
    // 1) render node as disabled
View Full Code Here

TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.