Examples of RichTextMutationBuilder


Examples of org.waveprotocol.wave.model.richtext.RichTextMutationBuilder

      // handle annotation starts
      StringMap<String> modified = annotationLogic.stripKeys(
          destDoc, pos, cursorBias, ContentType.RICH_TEXT, builder);

      // parse the tokens and apply ops
      RichTextMutationBuilder mutationBuilder = new RichTextMutationBuilder(modified);
      ReadableStringSet affectedKeys =
          mutationBuilder.applyMutations(tokenizer, builder, destDoc, insertAt.getContainer());

      // close annotations and finish
      annotationLogic.unstripKeys(builder, modified.keySet(), affectedKeys);
      builder.finish();
      Nindo nindo = builder.build();

      try {
        validator.maybeThrowOperationExceptionFor(nindo);

        destOperationSequencer.begin();
        destOperationSequencer.consume(nindo);
        destOperationSequencer.end();

        int cursorLocation = pos + mutationBuilder.getLastGoodCursorOffset();
        Point<ContentNode> caret = mapper.locate(cursorLocation);
        aggressiveSelectionHelper.setCaret(caret);
      } catch (OperationException e) {
        LOG.error().log("Paste failed");
        aggressiveSelectionHelper.setCaret(insertAt);
View Full Code Here

Examples of org.waveprotocol.wave.model.richtext.RichTextMutationBuilder

      // handle annotation starts
      StringMap<String> modified = annotationLogic.stripKeys(
          destDoc, pos, cursorBias, ContentType.RICH_TEXT, builder);

      // parse the tokens and apply ops
      RichTextMutationBuilder mutationBuilder = new RichTextMutationBuilder(modified);
      ReadableStringSet affectedKeys =
          mutationBuilder.applyMutations(tokenizer, builder, destDoc, insertAt.getContainer());

      // close annotations and finish
      annotationLogic.unstripKeys(builder, modified.keySet(), affectedKeys);
      builder.finish();
      Nindo nindo = builder.build();

      try {
        validator.maybeThrowOperationExceptionFor(nindo);

        destOperationSequencer.begin();
        destOperationSequencer.consume(nindo);
        destOperationSequencer.end();

        int cursorLocation = pos + mutationBuilder.getLastGoodCursorOffset();
        Point<ContentNode> caret = mapper.locate(cursorLocation);
        aggressiveSelectionHelper.setCaret(caret);
      } catch (OperationException e) {
        LOG.error().log("Paste failed");
        aggressiveSelectionHelper.setCaret(insertAt);
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.