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

Examples of org.waveprotocol.wave.model.document.operation.impl.DocOpBuffer.finish()


  public void testWaveletDocumentOperationDocumentId() {
    OpEquator eq = OpComparators.SYNTACTIC_IDENTITY;

    DocOpBuffer b = new DocOpBuffer();
    b.characters("a");
    DocOp d = b.finish();

    CoreWaveletDocumentOperation a1 = new CoreWaveletDocumentOperation("a", d);
    CoreWaveletDocumentOperation a2 = new CoreWaveletDocumentOperation("a", d);
    CoreWaveletDocumentOperation b1 = new CoreWaveletDocumentOperation("b", d);
    CoreWaveletDocumentOperation b2 = new CoreWaveletDocumentOperation("b", d);
View Full Code Here


  public void testWaveletDocumentOperationDocOp() {
    OpEquator eq = OpComparators.SYNTACTIC_IDENTITY;

    DocOpBuffer ba = new DocOpBuffer();
    ba.characters("a");
    DocOp da = ba.finish();
    DocOpBuffer bb = new DocOpBuffer();
    bb.deleteCharacters("a");
    DocOp db = bb.finish();

    CoreWaveletDocumentOperation a1 = new CoreWaveletDocumentOperation("a", da);
View Full Code Here

    DocOpBuffer ba = new DocOpBuffer();
    ba.characters("a");
    DocOp da = ba.finish();
    DocOpBuffer bb = new DocOpBuffer();
    bb.deleteCharacters("a");
    DocOp db = bb.finish();

    CoreWaveletDocumentOperation a1 = new CoreWaveletDocumentOperation("a", da);
    CoreWaveletDocumentOperation a2 = new CoreWaveletDocumentOperation("a", da);
    CoreWaveletDocumentOperation b1 = new CoreWaveletDocumentOperation("a", db);
    CoreWaveletDocumentOperation b2 = new CoreWaveletDocumentOperation("a", db);
View Full Code Here

  // converts the DOM to a string.
  private static String toSimpleString(ReadableDocument<ContentNode, ?, ?> doc) {
    DocOpBuffer opBuffer = new DocOpBuffer();
    DomOperationUtil.buildDomInitializationFromSubtree(doc, doc.getDocumentElement(), opBuffer);
    return DocOpUtil.toXmlString(DocOpUtil.asInitialization(opBuffer.finish()));
  }
}
View Full Code Here

    b.updateAttributes(new AttributesUpdateImpl("P", null, "", ":wq", "ZZ", null));
    b.annotationBoundary(AnnotationBoundaryMapImpl.builder()
        .initializationEnd("e", "f-")
        .build());

    return b.finish();
  }
}
View Full Code Here

    DocOp generate() {
      DocOpAutomaton a = new DocOpAutomaton(doc, DocumentSchema.NO_SCHEMA_CONSTRAINTS);
      DocOpBuffer b = new DocOpBuffer();
      generate1(a, b);
      return b.finish();
    }

    RandomizerOperationComponent pickComponent(final DocOpAutomaton a, final Stage stage) {
//      System.err.println("stage: " + stage);
      RandomizerOperationComponent component = pickRandomNonNullMappedElement(r,
View Full Code Here

    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

    // 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

    // 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

    b.updateAttributes(new AttributesUpdateImpl("P", null, "", ":wq", "ZZ", null));
    b.annotationBoundary(AnnotationBoundaryMapImpl.builder()
        .initializationEnd("e", "f-")
        .build());

    return b.finish();
  }
}
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.