Examples of DocOpBuilder


Examples of com.google.collide.shared.ot.DocOpBuilder

  }

  void ensureQueuedDocOp() {
    if (fileConcurrencyController.getQueuedClientOpCount() == 0) {
      // There aren't any queued doc ops, create and send a noop doc op
      DocOp noopDocOp = new DocOpBuilder(ClientDocOpFactory.INSTANCE, false).retainLine(
          document.getLineCount()).build();
      fileConcurrencyController.consumeLocalDocOp(noopDocOp);
    }
  }
View Full Code Here

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

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

  }

  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

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

  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

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

        .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

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

          .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

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

  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

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

        .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

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

    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

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

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