Package com.google.collide.shared.document

Examples of com.google.collide.shared.document.LineInfo.moveToNext()


    LineInfo lineInfo = viewport.getTopLineInfo();
    do {
      if (RegExpUtils.resetAndTest(searchPattern, lineInfo.line().getText())) {
        renderer.requestRenderLine(lineInfo.line());
      }
    } while (lineInfo.line() != viewport.getBottomLine() && lineInfo.moveToNext());

    searchPattern = null;
  }

}
View Full Code Here


        column = preferredCursorColumn;
        if (lineInfo.line() == document.getLastLine() && (isShiftHeld || UserAgent.isMac())) {
          // Consistent with up-arrowing on first line
          column = LineUtils.getLastCursorColumn(lineInfo.line());
        } else {
          lineInfo.moveToNext();
        }

        column = rubberbandColumn(lineInfo.line(), column);
        shouldUpdatePreferredColumn = false;
        break;
View Full Code Here

        shouldUpdatePreferredColumn = false;
        break;

      case PAGE_DOWN:
        for (int i = buffer.getFlooredHeightInLines(); i > 0; i--) {
          lineInfo.moveToNext();
        }
        column = rubberbandColumn(lineInfo.line(), preferredCursorColumn);
        shouldUpdatePreferredColumn = false;
        break;
View Full Code Here

        column = getLastCursorColumn(lineInfo.line());
      } else {
        column = 0;
      }
    } else if (column > getLastCursorColumn(lineInfo.line())) {
      if (lineInfo.moveToNext()) {
        column = LineUtils.getFirstCursorColumn(lineInfo.line());
      } else {
        column = rubberbandColumn(lineInfo.line(), column);
      }
    }
View Full Code Here

        // The cursor is on column 0 regardless
        newColumn = 0;
        if (growForward) {
          // If growing forward, move to the next line, if possible
          newLineInfo = targetLineInfo.copy();
          if (!newLineInfo.moveToNext()) {
            /*
             * There isn't a next line, so just move the cursor to the end of
             * line
             */
            newColumn = LineUtils.getLastCursorColumn(newLineInfo.line());
View Full Code Here

  public void testStartingAtLineWorks() {
    ViewportModel viewport = createMockViewport(document, 5);
    SearchTask task = new SearchTask(document, viewport, scheduler);

    LineInfo lineInfo = viewport.getTopLineInfo();
    lineInfo.moveToNext();

    SearchTaskExecutor executor = EasyMock.createMock(SearchTaskExecutor.class);
    expect(executor.onSearchLine(lineInfo.line(), 1, true)).andReturn(true);
    expect(
        executor.onSearchLine(EasyMock.anyObject(Line.class), EasyMock.anyInt(), EasyMock.eq(true)))
View Full Code Here

    // Now ask it about each line in our document and check to see if its right
    Document doc = SearchTestsUtil.createDocument();
    LineInfo lineInfo = doc.getFirstLineInfo();
    for (int i = 0; i < 6; i++) {
      assertFalse(renderer.resetToBeginningOfLine(lineInfo.line(), lineInfo.number()));
      lineInfo.moveToNext();
    }
   
    // Check that this line is parsed correctly
    ImmutableList<Integer> lengthList = ImmutableList.of(41, 4);
    Target mockTarget = createMockTarget(lengthList, false);
View Full Code Here

    Target mockTarget = createMockTarget(lengthList, false);
    assertTrue(renderer.resetToBeginningOfLine(lineInfo.line(), lineInfo.number()));
    for (int i = 0; i < lengthList.size(); i++) {
      renderer.renderNextChunk(mockTarget);
    }
    lineInfo.moveToNext();
    verify(mockTarget);
   
    assertFalse(renderer.resetToBeginningOfLine(lineInfo.line(), lineInfo.number()));
    lineInfo.moveToNext();
   
View Full Code Here

    }
    lineInfo.moveToNext();
    verify(mockTarget);
   
    assertFalse(renderer.resetToBeginningOfLine(lineInfo.line(), lineInfo.number()));
    lineInfo.moveToNext();
   
    // The next fun line
    lengthList = ImmutableList.of(4,1,4,4,4,1,4,1,4,3,4,1,4);
    mockTarget = createMockTarget(lengthList, true);
    assertTrue(renderer.resetToBeginningOfLine(lineInfo.line(), lineInfo.number()));
View Full Code Here

    mockTarget = createMockTarget(lengthList, true);
    assertTrue(renderer.resetToBeginningOfLine(lineInfo.line(), lineInfo.number()));
    for (int i = 0; i < lengthList.size(); i++) {
      renderer.renderNextChunk(mockTarget);
    }
    lineInfo.moveToNext();
    verify(mockTarget);
   
    assertFalse(renderer.resetToBeginningOfLine(lineInfo.line(), lineInfo.number()));
    lineInfo.moveToNext();
    assertFalse(renderer.resetToBeginningOfLine(lineInfo.line(), lineInfo.number()));
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.