Package org.waveprotocol.wave.model.document.operation

Examples of org.waveprotocol.wave.model.document.operation.DocOp$IsDocOp


    // step 5: remove the entire range
    deleteRange(removeStart, removeEnd);

    // step 6: compose then consume the insertion op:
    DocOp atomicInsert;
    try {
      atomicInsert = Composer.compose(domOp.finish(), annotOp.finish());
      hackConsume(Nindo.fromDocOp(atomicInsert, true));
    } catch (OperationException e) {
      // should never happen, we constructed composable ops
View Full Code Here


    }
    if (newestBlip == null) {
      // Render whatever data we have and hope its good enough
      sb.append(collateTextForWavelet(wavelet));
    } else {
      DocOp docOp = newestBlip.getContent().asOperation();
      sb.append(collateTextForOps(Lists.newArrayList(docOp)));
      sb.append(" ");
      docOp.apply(InitializationCursorAdapter.adapt(new DocInitializationCursor() {
        @Override
        public void annotationBoundary(AnnotationBoundaryMap map) {
        }

        @Override
View Full Code Here

        }
        ++index;
        if (comparison > 0) {
          transformedServerOps.add(fromServer);
        } else {
          DocOp clientOp = fromClient.operations.composeAll();
          DocOp serverOp = fromServer.operations.composeAll();
          OperationPair<DocOp> transformedOps = Transformer.transform(clientOp, serverOp);
          transformedClientOps.add(new DocumentOperations(fromClient.id,
              new DocOpList.Singleton(transformedOps.clientOp())));
          transformedServerOps.add(new DocumentOperations(fromClient.id,
              new DocOpList.Singleton(transformedOps.serverOp())));
View Full Code Here

    isConsistent = false;

    beginConsume(saveSelection);

    DocOp op = null;
    try {
      op = indexedDoc.consumeAndReturnInvertible(nindo, false);
    } catch (OperationException e) {
      dealWithBadOp(true, nindo, e, true);
    } catch (RuntimeException e) {
View Full Code Here

  /**
   * Plays a single operation from the queue
   */
  private void playOne() {
    if (queue.size() > 0) {
      DocOp operation = queue.remove(0);
      try {
        outputOperation(operation);
        editorBundle2.execute(operation);
        outputEditorState(editor2, prettyContent2, prettyHtml2);
      } catch (Throwable t) {
View Full Code Here

      this.saveSelection = saveSelection;
    }

    @Override
    public DocOp consumeAndReturnInvertible(Nindo op) {
      DocOp docOp = consumeLocal(op, saveSelection);
      outgoingOperationSink.consume(docOp);
      return docOp;
    }
View Full Code Here

    // create op, wrapping the tree operations within retains.
    DocOpBuffer opBuffer = new DocOpBuffer();
    safeRetain(opBuffer, position);
    DomOperationUtil.buildDomInitializationFromSubtree(localDoc, localNode, opBuffer);
    safeRetain(opBuffer, remainder);
    DocOp op = opBuffer.finish();

    // fake out the node creation, and consume:
    nodeCreationDelegate =
      new ReadableTreeWalker<ContentNode, ContentElement, ContentTextNode>(localDoc, localNode);
    sink.consume(op);
View Full Code Here

      blipId = null;
    }

    @Override
    public void visitBlipContentOperation(BlipContentOperation op) {
      DocOp mutationOp = op.getContentOp();

      message.setMutateDocument(createMutateDocumentMessage(blipId, mutationOp));
    }
View Full Code Here

      List<DocOp> ops = Lists.newArrayList(xhr.ops);
      assert ops.size() > 0;
      xhr = null;

      for (int i = appliesToRev; i < endRevision; i++) {
        DocOp serverOp = opAppliedAt(i).onlyOp();
        for (int j = 0; j < ops.size(); j++) {
          OperationPair<DocOp> pair = transformer.transform(ops.get(j), serverOp);
          serverOp = pair.serverOp();
          ops.set(j, pair.clientOp());
        }
View Full Code Here

          pkg.clientSourced ? clientSid : otherSid, pkg.onlyOp());
    }
  }

  private DocOp randomOp(Doc doc) {
    DocOp op = RandomDocOpGenerator.generate(r, p, doc.autoDoc);
    try {
      doc.consume(op);
    } catch (OperationException e) {
      throw new RuntimeException(e);
    }
View Full Code Here

TOP

Related Classes of org.waveprotocol.wave.model.document.operation.DocOp$IsDocOp

Copyright © 2018 www.massapicom. 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.