• 如果您觉得本站非常有看点,那么赶紧使用Ctrl+D 收藏吧

Java DocProviders类的典型用法和代码示例

java 3次浏览

本文整理汇总了Java中org.waveprotocol.wave.model.document.util.DocProviders的典型用法代码示例。如果您正苦于以下问题:Java DocProviders类的具体用法?Java DocProviders怎么用?Java DocProviders使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。

DocProviders类属于org.waveprotocol.wave.model.document.util包,在下文中一共展示了DocProviders类的26个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Java代码示例。

示例1: testAnchorRemovalIsUnworthy1

点赞 3

import org.waveprotocol.wave.model.document.util.DocProviders; //导入依赖的package包/类
public void testAnchorRemovalIsUnworthy1() throws OperationException {
  IndexedDocument<Node, Element, Text> d = DocProviders.POJO.build(
      new DocInitializationBuilder()
          .annotationBoundary(new AnnotationBoundaryMapBuilder().change("a", null, "b").build())
          .characters("a")
          .annotationBoundary(new AnnotationBoundaryMapBuilder().end("a").build())
          .characters("a")
          .elementStart(WorthyChangeChecker.THREAD_INLINE_ANCHOR_TAGNAME, Attributes.EMPTY_MAP)
          .elementEnd()
          .build(),
      DocumentSchema.NO_SCHEMA_CONSTRAINTS);
  DocOp op = d.consumeAndReturnInvertible(new Nindo.Builder() {
    {
      skip(2);
      deleteElementStart();
      deleteElementEnd();
    }
  }.build());
  assertFalse(WorthyChangeChecker.isWorthy(op));
}
 

开发者ID:jorkey,
项目名称:Wiab.pro,
代码行数:21,
代码来源:WorthyChangeCheckerTest.java

示例2: XtestAnchorRemovalIsUnworthy2

点赞 3

import org.waveprotocol.wave.model.document.util.DocProviders; //导入依赖的package包/类
public void XtestAnchorRemovalIsUnworthy2() throws OperationException {
  IndexedDocument<Node, Element, Text> d = DocProviders.POJO.build(
      new DocInitializationBuilder()
          .annotationBoundary(new AnnotationBoundaryMapBuilder().change("a", null, "b").build())
          .elementStart(WorthyChangeChecker.THREAD_INLINE_ANCHOR_TAGNAME, Attributes.EMPTY_MAP)
          .elementEnd()
          .annotationBoundary(new AnnotationBoundaryMapBuilder().end("a").build())
          .build(),
      DocumentSchema.NO_SCHEMA_CONSTRAINTS);
  DocOp op = d.consumeAndReturnInvertible(new Nindo.Builder() {
    {
      deleteElementStart();
      deleteElementEnd();
    }
  }.build());
  assertFalse(WorthyChangeChecker.isWorthy(op));
}
 

开发者ID:jorkey,
项目名称:Wiab.pro,
代码行数:18,
代码来源:WorthyChangeCheckerTest.java

示例3: applyTokensToEmptyDoc

点赞 3

import org.waveprotocol.wave.model.document.util.DocProviders; //导入依赖的package包/类
private Pair<Nindo, IndexedDocument<Node, Element, Text>> applyTokensToEmptyDoc(
    RichTextTokenizer tokens) {
  IndexedDocument<Node, Element, Text> doc = DocProviders.POJO.parse("<body><line/></body>");
  Point<Node> insertAt = doc.locate(3);

  Nindo.Builder builder = new Nindo.Builder();
  builder.skip(3);
  new RichTextMutationBuilder().applyMutations(tokens, builder, doc, insertAt.getContainer());

  Nindo nindo = builder.build();
  try {
    doc.consumeAndReturnInvertible(nindo);
  } catch (OperationException e) {
    fail("Operation Exception " + e);
  }

  return new Pair<Nindo, IndexedDocument<Node,Element,Text>>(nindo, doc);
}
 

开发者ID:jorkey,
项目名称:Wiab.pro,
代码行数:19,
代码来源:RichTextMutationBuilderTest.java

示例4: testAnnotationThroughInsertionEndingInDeletion

点赞 3

import org.waveprotocol.wave.model.document.util.DocProviders; //导入依赖的package包/类
public void testAnnotationThroughInsertionEndingInDeletion() throws OperationException {
  IndexedDocument<Node, Element, Text> doc = DocProviders.POJO.parse("abcdefg");

  Nindo.Builder b;

  b = new Nindo.Builder();
  b.skip(1);
  b.startAnnotation("a", "2");
  b.skip(1);
  b.endAnnotation("a");
  checkApply(doc, b.build());


  b = new Nindo.Builder();
  b.skip(1);
  b.startAnnotation("a", "1");
  b.characters("x");
  b.deleteCharacters(1);
  b.endAnnotation("a");
  checkApply(doc, b.build());
}
 

开发者ID:jorkey,
项目名称:Wiab.pro,
代码行数:22,
代码来源:IndexedDocumentImplTest.java

示例5: testAnnotationThroughInsertionFollowedByDeletion

点赞 3

import org.waveprotocol.wave.model.document.util.DocProviders; //导入依赖的package包/类
public void testAnnotationThroughInsertionFollowedByDeletion() throws OperationException {
  IndexedDocument<Node, Element, Text> doc = DocProviders.POJO.parse("abcdefg");

  Nindo.Builder b;

  b = new Nindo.Builder();
  b.skip(1);
  b.startAnnotation("a", "2");
  b.skip(1);
  b.endAnnotation("a");
  checkApply(doc, b.build());


  b = new Nindo.Builder();
  b.skip(1);
  b.startAnnotation("a", "1");
  b.characters("x");
  b.endAnnotation("a");
  b.deleteCharacters(1);
  checkApply(doc, b.build());
}
 

开发者ID:jorkey,
项目名称:Wiab.pro,
代码行数:22,
代码来源:IndexedDocumentImplTest.java

示例6: testInsertionThenDeletionWithAnnotations

点赞 3

import org.waveprotocol.wave.model.document.util.DocProviders; //导入依赖的package包/类
public void testInsertionThenDeletionWithAnnotations() throws OperationException {
  IndexedDocument<Node, Element, Text> doc = DocProviders.POJO.parse("abcdefg");

  Nindo.Builder b;

  b = new Nindo.Builder();
  b.skip(1);
  b.startAnnotation("a", "2");
  b.skip(2);
  b.endAnnotation("a");
  checkApply(doc, b.build());


  b = new Nindo.Builder();
  b.skip(1);
  b.startAnnotation("a", null);
  b.characters("x");
  b.deleteCharacters(1);
  b.skip(1);
  b.endAnnotation("a");
  checkApply(doc, b.build());
}
 

开发者ID:jorkey,
项目名称:Wiab.pro,
代码行数:23,
代码来源:IndexedDocumentImplTest.java

示例7: testReAnnotate

点赞 3

import org.waveprotocol.wave.model.document.util.DocProviders; //导入依赖的package包/类
public void testReAnnotate() throws OperationException {
  IndexedDocument<Node, Element, Text> doc = DocProviders.POJO.parse("abcdefg");

  Nindo.Builder b;

  b = new Nindo.Builder();
  b.skip(1);
  b.startAnnotation("a", "2");
  b.skip(1);
  b.startAnnotation("a", "3");
  b.skip(1);
  b.endAnnotation("a");
  checkApply(doc, b.build());

  b = new Nindo.Builder();
  b.skip(1);
  b.startAnnotation("a", "3");
  b.skip(2);
  b.endAnnotation("a");
  checkApply(doc, b.build());
}
 

开发者ID:jorkey,
项目名称:Wiab.pro,
代码行数:22,
代码来源:IndexedDocumentImplTest.java

示例8: testEndBeforeAndStartAfterDeletion

点赞 3

import org.waveprotocol.wave.model.document.util.DocProviders; //导入依赖的package包/类
public void testEndBeforeAndStartAfterDeletion() throws OperationException {
  IndexedDocument<Node, Element, Text> doc = DocProviders.POJO.parse("abcdefg");

  Nindo.Builder b;

  b = new Nindo.Builder();
  b.skip(1);
  b.startAnnotation("a", null);
  b.skip(1);
  b.endAnnotation("a");
  b.deleteCharacters(1);
  b.startAnnotation("a", "1");
  b.skip(1);
  b.endAnnotation("a");
  checkApply(doc, b.build());
}
 

开发者ID:jorkey,
项目名称:Wiab.pro,
代码行数:17,
代码来源:IndexedDocumentImplTest.java

示例9: testEndBeforeAndStartAfterDeletionThenInsertion

点赞 3

import org.waveprotocol.wave.model.document.util.DocProviders; //导入依赖的package包/类
public void testEndBeforeAndStartAfterDeletionThenInsertion() throws OperationException {
  IndexedDocument<Node, Element, Text> doc = DocProviders.POJO.parse("abcdefg");

  Nindo.Builder b;

  b = new Nindo.Builder();
  b.skip(1);
  b.startAnnotation("a", null);
  b.skip(1);
  b.endAnnotation("a");
  b.deleteCharacters(1);
  b.startAnnotation("a", "1");
  b.characters("x");
  b.endAnnotation("a");
  checkApply(doc, b.build());
}
 

开发者ID:jorkey,
项目名称:Wiab.pro,
代码行数:17,
代码来源:IndexedDocumentImplTest.java

示例10: testOpenDuringInsertionThenUpdate

点赞 3

import org.waveprotocol.wave.model.document.util.DocProviders; //导入依赖的package包/类
public void testOpenDuringInsertionThenUpdate() throws OperationException {
   IndexedDocument<Node, Element, Text> doc =
DocProviders.POJO.parse("<q><r/></q>abcdefghijkl");

   Nindo.Builder b;

   b = new Nindo.Builder();
   b.startAnnotation("a", "1");
   b.skip(7);
   b.endAnnotation("a");
   checkApply(doc, b.build());

   b = new Nindo.Builder();
   b.elementStart("p", Attributes.EMPTY_MAP);
   b.startAnnotation("a", null);
   b.elementEnd();
   b.updateAttributes(Collections.singletonMap("u", "v"));
   b.replaceAttributes(new AttributesImpl("v", "u"));
   b.skip(1);
   b.endAnnotation("a");
   checkApply(doc, b.build());
 }
 

开发者ID:jorkey,
项目名称:Wiab.pro,
代码行数:23,
代码来源:IndexedDocumentImplTest.java

示例11: testOpenDuringInsertionThenUpdate2

点赞 3

import org.waveprotocol.wave.model.document.util.DocProviders; //导入依赖的package包/类
public void testOpenDuringInsertionThenUpdate2() throws OperationException {
   IndexedDocument<Node, Element, Text> doc =
DocProviders.POJO.parse("abcdef<q><r/></q>ghijkl");

   Nindo.Builder b;

   b = new Nindo.Builder();
   b.skip(8);
   b.startAnnotation("a", "1");
   b.skip(5);
   b.endAnnotation("a");
   checkApply(doc, b.build());

   b = new Nindo.Builder();
   b.startAnnotation("a", "1");
   b.skip(7);
   b.updateAttributes(Collections.singletonMap("u", "v"));
   //b.replaceAttributes(new AttributesImpl("v", "u"));
   b.skip(3);
   b.endAnnotation("a");
   checkApply(doc, b.build());
 }
 

开发者ID:jorkey,
项目名称:Wiab.pro,
代码行数:23,
代码来源:IndexedDocumentImplTest.java

示例12: testSplitTextNeverReturnsSibling

点赞 3

import org.waveprotocol.wave.model.document.util.DocProviders; //导入依赖的package包/类
public void testSplitTextNeverReturnsSibling() {
  TestDocumentContext<Node, Element, Text> cxt = ContextProviders.createTestPojoContext(
      DocProviders.POJO.parse("ab").asOperation(),
      null, null, null, DocumentSchema.NO_SCHEMA_CONSTRAINTS);

  TextNodeOrganiser<Text> organiser = cxt.textNodeOrganiser();
  MutableDocument<Node, Element, Text> doc = cxt.document();
  Text first = (Text) doc.getFirstChild(doc.getDocumentElement());
  Text text = organiser.splitText(first, 1);
  LocalDocument<Node, Element, Text> local = cxt.annotatableContent();

  Element tr = local.transparentCreate("l", Attributes.EMPTY_MAP, doc.getDocumentElement(), text);
  local.transparentMove(tr, text, null, null);

  assertNull(cxt.getIndexedDoc().splitText(first, 1));
  assertNull(organiser.splitText(first, 1));

  assertSame(first, organiser.splitText(first, 0));
  assertSame(first, organiser.splitText(first, 0));

  assertEquals("a<l>b</l>", XmlStringBuilder.innerXml(local).toString());
  assertEquals("ab", XmlStringBuilder.innerXml(doc).toString());
}
 

开发者ID:jorkey,
项目名称:Wiab.pro,
代码行数:24,
代码来源:IndexedDocumentImplTest.java

示例13: setContent

点赞 3

import org.waveprotocol.wave.model.document.util.DocProviders; //导入依赖的package包/类
/**
 * Sets editor content and selection with string like <p>a[bc]d</p>
 * First expands the string according to current abbreviations.
 * Also asserts that resulting content + selection got set properly
 *
 * @param editor
 * @param content
 * @throws OperationException
 */
protected void setContent(Editor editor, String content)
    throws OperationException {

  // Parse content
  ContentWithSelection parsed = parseContent(content);

  // Set content + selection in editor
  editor.setContent(DocProviders.POJO.parse(parsed.content).asOperation(),
      TEST_SCHEMA);
  editor.getSelectionHelper().setSelectionRange(parsed.selection == null ? null
      : new FocusedRange(parsed.selection.getStart(), parsed.selection.getEnd()));

  // Assert editor health (editor already does this in debug builds)
  if (!LogLevel.showDebug()) {
    EditorTestingUtil.checkHealth(editor);
  }
  // Assert content and selection
  assertEditorContent(
      "Editor.setContent(" + abbreviations.expand(content) + ")", parsed, editor);
}
 

开发者ID:jorkey,
项目名称:Wiab.pro,
代码行数:30,
代码来源:TestBase.java

示例14: setUp

点赞 3

import org.waveprotocol.wave.model.document.util.DocProviders; //导入依赖的package包/类
@Override
protected void setUp() throws Exception {
  super.setUp();

  doc = DocProviders.POJO.parse("<doc>hello</doc>");
  silentOperationSink =
      new SilentOperationSink<DocOp>() {
        
        @Override
        public void consume(DocOp op) {
          try {
            doc.consume(op);
          } catch (OperationException e) {
            e.printStackTrace();
            throw new RuntimeException(e);
          }
        }
      };

  selectionHelper = new DocumentFreeSelectionHelper(0, 0);
  responsibility = new ResponsibilityManagerImpl();
  undoManager =
      new EditorUndoManagerImpl(UndoManagerFactory.createUndoManager(),
          silentOperationSink, selectionHelper);
}
 

开发者ID:jorkey,
项目名称:Wiab.pro,
代码行数:26,
代码来源:EditorUndoManagerImplTest.java

示例15: getBlipDocInitialization

点赞 3

import org.waveprotocol.wave.model.document.util.DocProviders; //导入依赖的package包/类
protected DocInitialization getBlipDocInitialization(String text) {

        DocInitialization op;
        String initContent = "<body><line/>" + text + "</body>";

        try {
            op = DocProviders.POJO.parse(initContent).asOperation();
        } catch (IllegalArgumentException e) {
            /*
            if (e.getCause() instanceof XmlParseException) {

            } else {

            }
            **/
            return null;
        }

        return op;
    }
 

开发者ID:apache,
项目名称:incubator-wave-android,
代码行数:21,
代码来源:Model.java

示例16: testFindCharacter

点赞 3

import org.waveprotocol.wave.model.document.util.DocProviders; //导入依赖的package包/类
public void testFindCharacter() {
  checkFindCharacter("<x>abcd</x>", 1, "a", true, 1);
  checkFindCharacter("<x>abcd</x>", 1, "b", true, 2);
  checkFindCharacter("<x>abcd</x>", 4, "d", true, 4);

  checkFindCharacter("<x>abcd</x>", 3, "a", false, 1);
  checkFindCharacter("<x>abcd</x>", 3, "b", false, 2);
  checkFindCharacter("<x>abcd</x>", 5, "d", false, 4);

  checkFindCharacter("<x>ab<a/>cd</x>", 1, "a", true, 1);
  checkFindCharacter("<x>ab<a/>cd</x>", 1, "b", true, 2);

  checkFindCharacter("<x>ab<a/>cd</x>", 1, "c", true, 3);
  checkFindCharacter("<x>ab<a/>cd</x>", 1, "d", true, 3);

  // Test with split text node
  MutableDocument<Node, Element, Text> doc = DocProviders.MOJO.parse("<x>hello</x>");
  DocHelperTest.insertTextInNewTextNodeHelper(doc, doc.locate(6), "world");
  Tx<Node> helloStart = doc.locate(1).asTextPoint();
  assertEquals(3, doc.getLocation(TextLocator.findCharacter(doc, helloStart, "l", true)));
  assertEquals(6, doc.getLocation(TextLocator.findCharacter(doc, helloStart, "w", true)));
  assertEquals(1, doc.getLocation(TextLocator.findCharacter(doc, helloStart, "h",
      false)));
}
 

开发者ID:apache,
项目名称:incubator-wave,
代码行数:25,
代码来源:TextLocatorTest.java

示例17: setUp

点赞 3

import org.waveprotocol.wave.model.document.util.DocProviders; //导入依赖的package包/类
@Override
protected void setUp() throws Exception {
  super.setUp();

  doc = DocProviders.POJO.parse("<doc>hello</doc>");
  silentOperationSink =
      new SilentOperationSink<DocOp>() {
        public void consume(DocOp op) {
          try {
            doc.consume(op);
          } catch (OperationException e) {
            e.printStackTrace();
            throw new RuntimeException(e);
          }
        }
      };

  selectionHelper = new DocumentFreeSelectionHelper(0, 0);
  responsibility = new ResponsibilityManagerImpl();
  undoManager =
      new EditorUndoManagerImpl(UndoManagerFactory.createUndoManager(),
          silentOperationSink, selectionHelper);
}
 

开发者ID:apache,
项目名称:incubator-wave,
代码行数:24,
代码来源:EditorUndoManagerImplTest.java

示例18: create

点赞 2

import org.waveprotocol.wave.model.document.util.DocProviders; //导入依赖的package包/类
@Override
public DocumentOperationSink create(final WaveletId waveletId, final String docId,
    final DocInitialization content) {
  return new DocumentOperationSink() {
        private final DocumentSchema schema = schemas.getSchemaForId(waveletId, docId);
        private final IndexedDocument<Node, Element, Text> document =
            DocProviders.POJO.build(content, schema);

        @Override
        public DocInitialization asOperation() {
          DocInitializationBuffer builder = new DocInitializationBuffer();
          document.asOperation().apply(builder);
          return builder.finish();
        }

        @Override
        public void consume(DocOp op) throws OperationException {
          document.consume(op);
        }

        @Override
        public Document getMutableDocument() {
          throw new UnsupportedOperationException(
              "This document implementation does not support mutable documents");
        }

        @Override
        public void init(SilentOperationSink<? super DocOp> outputSink) {
          throw new UnsupportedOperationException(
              "This document implementation does not support mutable documents");
        }
      };
}
 

开发者ID:jorkey,
项目名称:Wiab.pro,
代码行数:34,
代码来源:IndexedDocumentFactory.java

示例19: webdriverEditorSetContent

点赞 2

import org.waveprotocol.wave.model.document.util.DocProviders; //导入依赖的package包/类
/**
 * @param editorDiv editor
 * @param content content to set
 */
public static void webdriverEditorSetContent(Element editorDiv, String content) {
  Editor editor = getByEditorDiv(editorDiv);
  if (editor != null) {
    Preconditions.checkNotNull(documentSchema, "documentSchema is not set");
    editor.setContent(DocProviders.POJO.parse(content).asOperation(), documentSchema);
  }
}
 

开发者ID:jorkey,
项目名称:Wiab.pro,
代码行数:12,
代码来源:EditorWebDriverUtil.java

示例20: testEmptyDocumentWithTitle

点赞 2

import org.waveprotocol.wave.model.document.util.DocProviders; //导入依赖的package包/类
/**
 * Test that the head of the document built by emptyDocumentWithTitle matches
 * the initial head in ConversationConstants.BLIP_INITIAL_HEAD.
 **/
public void testEmptyDocumentWithTitle() {
  IndexedDocument<Node, Element, Text> d = DocProviders.POJO.build(
      TitleHelper.emptyDocumentWithTitle(),
      DocumentSchema.NO_SCHEMA_CONSTRAINTS);
  String message = Blips.INITIAL_CONTENT.toString() +
      " expected, found " + XmlStringBuilder.innerXml(d).toString();
  assertTrue(message, DocCompare.equivalent(DocCompare.STRUCTURE,
      Blips.INITIAL_CONTENT.toString(), d));
}
 

开发者ID:jorkey,
项目名称:Wiab.pro,
代码行数:14,
代码来源:TitleHelperTest.java

示例21: getInitialBlipBodyPosition

点赞 2

import org.waveprotocol.wave.model.document.util.DocProviders; //导入依赖的package包/类
/**
 * Returns the position of the body element in an initial, empty, blip.
 */
public static int getInitialBlipBodyPosition() {
  IndexedDocument<Node, Element, Text> d = DocProviders.POJO.build(
      TitleHelper.emptyDocumentWithTitle(),
      DocumentSchema.NO_SCHEMA_CONSTRAINTS);
  return getBodyPosition(d);
}
 

开发者ID:jorkey,
项目名称:Wiab.pro,
代码行数:10,
代码来源:BlipTestUtils.java

示例22: setupDoc

点赞 2

import org.waveprotocol.wave.model.document.util.DocProviders; //导入依赖的package包/类
private void setupDoc() {
  ObservablePluggableMutableDocument doc =
      new ObservablePluggableMutableDocument(
          DocumentSchema.NO_SCHEMA_CONSTRAINTS, DocProviders.POJO.parse("").asOperation());
  doc.init(SilentOperationSink.VOID);
  listener = mock(Listener.class);
  states = GadgetStateCollection.create(DefaultDocumentEventRouter.create(doc),
      doc.getDocumentElement(), listener);
}
 

开发者ID:jorkey,
项目名称:Wiab.pro,
代码行数:10,
代码来源:GadgetStateCollectionTest.java

示例23: init

点赞 2

import org.waveprotocol.wave.model.document.util.DocProviders; //导入依赖的package包/类
/** Init document state */
protected void init(String initialContent) {
  indexed = DocProviders.POJO.parse(initialContent);

  // Get a mutable doc view of our target and hook it up with the
  // "remote" document as the sink of outgoing ops.
  doc = new MutableDocumentImpl<Node, Element, Text>(
      createSequencer(indexed), indexed);
}
 

开发者ID:jorkey,
项目名称:Wiab.pro,
代码行数:10,
代码来源:MutableDocumentImplTest.java

示例24: create

点赞 2

import org.waveprotocol.wave.model.document.util.DocProviders; //导入依赖的package包/类
private void create(String xml) {

    DomDocumentImpl raw = DocProviders.ROJO.parse("<d>" + xml + "</d>");
    DomDocumentImpl raw2 = DocProviders.ROJO.parse("<d>" + xml + "</d>");

    indexed = new ObservableIndexedDocument<Node, Element, Text, Void>(handler, raw, null,
        DocumentSchema.NO_SCHEMA_CONSTRAINTS);
    indexedCopy = new ObservableIndexedDocument<Node, Element, Text, Void>(
        handler2, raw2, null, DocumentSchema.NO_SCHEMA_CONSTRAINTS);

    doc = new MutableDocumentImpl<Node, Element, Text>(
        new OperationSequencer<Nindo>() {

      @Override
      public void begin() {
      }

      @Override
      public void consume(Nindo op) {
        try {
          consumeNindo(op);
        } catch (OperationException e) {
          throw new OperationRuntimeException("Bug!", e);
        }
      }

      @Override
      public void end() {
      }
    }, testNindoConsume ? indexed : indexedCopy);

    root = doc.getDocumentElement();
  }
 

开发者ID:jorkey,
项目名称:Wiab.pro,
代码行数:34,
代码来源:ObservableIndexedDocumentTest.java

示例25: testChangeBetweenInsertionAndDeletion

点赞 2

import org.waveprotocol.wave.model.document.util.DocProviders; //导入依赖的package包/类
public void testChangeBetweenInsertionAndDeletion() throws OperationException {
  IndexedDocument<Node, Element, Text> doc = DocProviders.POJO.parse("abcdefg");

  Nindo.Builder b;

  b = new Nindo.Builder();
  b.skip(1);
  b.startAnnotation("a", "1");
  b.characters("x");
  b.startAnnotation("a", "2");
  b.deleteCharacters(1);
  b.skip(1);
  b.endAnnotation("a");
  checkApply(doc, b.build());
}
 

开发者ID:jorkey,
项目名称:Wiab.pro,
代码行数:16,
代码来源:IndexedDocumentImplTest.java

示例26: testOpenClose

点赞 2

import org.waveprotocol.wave.model.document.util.DocProviders; //导入依赖的package包/类
public void testOpenClose() throws OperationException {
  IndexedDocument<Node, Element, Text> doc = DocProviders.POJO.parse("abcdefg");

  Nindo.Builder b;

  b = new Nindo.Builder();
  b.skip(1);
  b.startAnnotation("a", "1");
  b.startAnnotation("b", "2");
  b.startAnnotation("c", "3");
  b.endAnnotation("a");
  b.endAnnotation("c");
  b.endAnnotation("b");
  checkApply(doc, b.build());
}
 

开发者ID:jorkey,
项目名称:Wiab.pro,
代码行数:16,
代码来源:IndexedDocumentImplTest.java


版权声明:本文转自网络文章,转载此文章仅为分享知识,如有侵权,请联系管理员进行删除。
喜欢 (0)