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

Examples of org.waveprotocol.wave.model.document.operation.impl.DocOpBuilder


      op.apply(createScrubber(b));
      return b.finishUnchecked();
    } catch (RuntimeException e) {
      // This should not really happen unless perhaps the input operation has some
      // diabolically broken implementation of apply ofr of attribute or annotation datastructures.
      return new DocOpBuilder().characters("Scrub exploded: " + e).build();
    }
  }
View Full Code Here


  }

  private BlipOperation createSampleContentOperation(WaveletOperationContext context,
      UpdateContributorMethod method) {
    // Some random op that doesn't actually update the document but still "isWorthy"
    DocOp op = new DocOpBuilder()
        .retain(1)
        .deleteElementStart("line", Attributes.EMPTY_MAP)
        .deleteElementEnd()
        .elementStart("line", Attributes.EMPTY_MAP)
        .elementEnd()
View Full Code Here

  private static final WaveletOperationContext CREATOR2_CONTEXT =
      new WaveletOperationContext(new ParticipantId(CREATOR2_ID), 0, 0);

  private DocOp insertDocOp(int location, int size) {
    return new DocOpBuilder()
        .retain(location)
        .characters("a")
        .retain(size - location)
        .build();
  }
View Full Code Here

        .retain(size - location)
        .build();
  }

  private DocOp deleteDocOp(int location, int size) {
    return new DocOpBuilder()
        .retain(location)
        .deleteCharacters("a")
        .retain(size - location)
        .build();
  }
View Full Code Here

          .docOp("doc", deleteDocOp)
          .build();

      WaveAggregateOp composed = compose(op1, op2);

      DocOp expectedDocOp = new DocOpBuilder()
          .retain(1)
          .characters("a")
          .deleteCharacters("a")
          .characters("a")
          .retain(1)
View Full Code Here

  static AggregateOperation addParticipant(String participantId) {
    return new AggregateOperation(new CoreAddParticipant(new ParticipantId(participantId)));
  }

  static AggregateOperation insert(String id, int location, int size) {
    return new AggregateOperation(new CoreWaveletDocumentOperation(id, new DocOpBuilder()
        .retain(location)
        .characters("a")
        .retain(size - location)
        .build()));
  }
View Full Code Here

        .retain(size - location)
        .build()));
  }

  static AggregateOperation delete(String id, int location, int size) {
    return new AggregateOperation(new CoreWaveletDocumentOperation(id, new DocOpBuilder()
        .retain(location)
        .deleteCharacters("a")
        .retain(size - location)
        .build()));
  }
View Full Code Here

    normalizer.retain(1);
    normalizer.retain(1);
    normalizer.characters("b");
    normalizer.retain(1);
    DocOp docOp = normalizer.finish();
    DocOp expected = new DocOpBuilder()
        .retain(1)
        .characters("a")
        .retain(3)
        .characters("b")
        .retain(1)
View Full Code Here

    normalizer.characters("a");
    normalizer.retain(0);
    normalizer.characters("b");
    normalizer.retain(1);
    DocOp docOp = normalizer.finish();
    DocOp expected = new DocOpBuilder()
        .retain(1)
        .characters("ab")
        .retain(1)
        .build();
    assertTrue(OpComparators.SYNTACTIC_IDENTITY.equal(expected, docOp));
View Full Code Here

    normalizer.characters("a");
    normalizer.characters("b");
    normalizer.characters("c");
    normalizer.retain(1);
    DocOp docOp = normalizer.finish();
    DocOp expected = new DocOpBuilder()
        .retain(1)
        .characters("abc")
        .retain(1)
        .build();
    assertTrue(OpComparators.SYNTACTIC_IDENTITY.equal(expected, docOp));
View Full Code Here

TOP

Related Classes of org.waveprotocol.wave.model.document.operation.impl.DocOpBuilder

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.