Examples of FocusedRange


Examples of org.waveprotocol.wave.model.document.util.FocusedRange

    }
  }

  @Override
  public void maybeCheckpoint(int startLocation, int endLocation) {
    pendingCheckpoint = new FocusedRange(startLocation, endLocation);
  }
View Full Code Here

Examples of org.waveprotocol.wave.model.document.util.FocusedRange

    DocOp undo = pair.first;
    DocOp transformedNonUndoable = pair.second;

    {
      FocusedRange selection = selectionHelper.getSelectionRange();

      if (selection != null) {
        redoSelectionStack.push(selection);
      } else {
        redoSelectionStack.push(UNKNOWN_SELECTION);
View Full Code Here

Examples of org.waveprotocol.wave.model.document.util.FocusedRange

    DocOp redo = pair.first;
    DocOp transformedNonUndoable = pair.second;

    {
      FocusedRange selection = selectionHelper.getSelectionRange();

      if (selection != null) {
        undoSelectionStack.push(selection);
      } else {
        undoSelectionStack.push(UNKNOWN_SELECTION);
View Full Code Here

Examples of org.waveprotocol.wave.model.document.util.FocusedRange

    if (selectionStack.isEmpty()) {
      logger.log(Level.ERROR,
          "SelectionStack empty! This probably shouldn't be reached, but we can live with it.");
      return null;
    }
    FocusedRange selection = selectionStack.pop();
    if (selection == UNKNOWN_SELECTION) {
      logger.log(Level.TRACE, "unknown selection");
      return null;
    } else {
      if (transformedNonUndoable != null) {
View Full Code Here

Examples of org.waveprotocol.wave.model.document.util.FocusedRange

    // Set content + selection in editor
    editor.setContent(DocProviders.POJO.parse(parsed.content).asOperation(),
        TEST_SCHEMA);
    editor.getSelectionHelper().setSelectionRange(parsed.selection == null ? null
        : new FocusedRange(parsed.selection.getStart(), parsed.selection.getEnd()));

    // Assert editor health (editor already does this in debug builds)
    if (!LogLevel.showDebug()) {
      EditorTestingUtil.checkHealth(editor);
    }
View Full Code Here

Examples of org.waveprotocol.wave.model.document.util.FocusedRange

      RootPanel.get().add(local);

      ContentWithSelection content = new ContentWithSelection(initialContent);
      ContentSerialisationUtil.setContentString(local, content.content);
      local.getAggressiveSelectionHelper().setSelectionRange(
          new FocusedRange(content.selection, true));

      remote = createEditor();
      RootPanel.get().add(remote);

      remote.setContent(local.getDocumentInitialization(),
View Full Code Here

Examples of org.waveprotocol.wave.model.document.util.FocusedRange

  }

  public void testBehaviour() {
    // Ignore own cursor
    me.extractor.writeSelection(
        cxt.document(), new FocusedRange(2, 4), "wo", handlerTimer.currentTimeMillis());
    assertTrue(markerFactory.markers.isEmpty());
    check("abcdefghij");

    joe.extractor.writeSelection(
        cxt.document(), new FocusedRange(1, 3), "ni", handlerTimer.currentTimeMillis());
    assertFalse(markerFactory.markers.isEmpty());
    CaretView joeUi = handler.getUiForSession(joe.id);
    verify(joeUi).setName("Joe");
    verify(joeUi).setCompositionState("ni");
    assertFalse(markerFactory.isAttached(joeUi));
    painterTimer.tick(10);
    assertTrue(markerFactory.isAttached(joeUi));
    check("a<s>bc</s><b/>defghij");

    joe.setName("Jimbo");
    verify(joeUi).setName("Jimbo");
    assertEquals(2, painterRegistry.getKeys().countEntries());

    handlerTimer.tick(STALE_CARET_TIMEOUT_MS / 2);
    joe.setName("Jimbo2");
    verify(joeUi, atMost(1)).setName("Jimbo2");

    // check cleanup after timeout
    handlerTimer.tick(STALE_CARET_TIMEOUT_MS);
    joe.setName("Jimbo3");
    verify(joeUi, never()).setName("Jimbo3");
    assertEquals(0, painterRegistry.getKeys().countEntries());

    joe.extractor.writeSelection(
        cxt.document(), new FocusedRange(2, 4), "ni", handlerTimer.currentTimeMillis());
    handlerTimer.tick(STALE_CARET_TIMEOUT_MS - 1);
    painterTimer.tick(10);
    joe.setName("Jimbo4");
    verify(joeUi).setName("Jimbo4");

    joe.extractor.writeSelection(
        cxt.document(), new FocusedRange(2, 4), "ni", handlerTimer.currentTimeMillis());
    handlerTimer.tick(STALE_CARET_TIMEOUT_MS - 1);
    painterTimer.tick(10);
    joe.setName("Jimbo5");
    verify(joeUi).setName("Jimbo5");
  }
View Full Code Here

Examples of org.waveprotocol.wave.model.document.util.FocusedRange

    undoManager.maybeCheckpoint(1, 1);
    responsibility.startDirectSequence();
    insert(1, 7);
    responsibility.endDirectSequence();
    undoManager.undo();
    assertTrue(selectionHelper.getSelectionRange().equals(new FocusedRange(1, 1)));
    assertEquals(XmlStringBuilder.innerXml(doc).toString(), "<doc>hello</doc>");
  }
View Full Code Here

Examples of org.waveprotocol.wave.model.document.util.FocusedRange

    undoManager.maybeCheckpoint(2, 2);
    insert(2, 8);
    responsibility.endDirectSequence();

    undoManager.undo();
    assertTrue(selectionHelper.getSelectionRange().equals(new FocusedRange(2, 2)));
    assertEquals(XmlStringBuilder.innerXml(doc).toString(), "<doc>ahello</doc>");

    undoManager.undo();
    assertTrue(selectionHelper.getSelectionRange().equals(new FocusedRange(1, 1)));
    assertEquals(XmlStringBuilder.innerXml(doc).toString(), "<doc>hello</doc>");
  }
View Full Code Here

Examples of org.waveprotocol.wave.model.document.util.FocusedRange

    undoManager.maybeCheckpoint(2, 2);
    insert(2, 8);
    responsibility.endDirectSequence();

    undoManager.undo();
    assertTrue(selectionHelper.getSelectionRange().equals(new FocusedRange(2, 2)));
    assertEquals(XmlStringBuilder.innerXml(doc).toString(), "<doc>ahello</doc>");

    undoManager.undo();
    assertTrue(selectionHelper.getSelectionRange().equals(new FocusedRange(1, 1)));
    assertEquals(XmlStringBuilder.innerXml(doc).toString(), "<doc>hello</doc>");
  }
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.