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

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


    docOpBuilder.deleteCharacters(TEXT);
    docOpRetainAndDeleteCharacters = new CoreWaveletDocumentOperation(DOC_ID, docOpBuilder.finish());

    docOpBuilder = new DocOpBuffer();
    docOpBuilder.elementStart("name1",
        new AttributesImpl(CollectionUtils.immutableMap("key1", "val1", "key2", "val2")));
    docOpBuilder.characters(TEXT);
    docOpBuilder.elementStart("name2",
        new AttributesImpl(CollectionUtils.immutableMap("key3", "val3", "key4", "val4")));
    docOpBuilder.characters(TEXT + TEXT);
    docOpBuilder.elementEnd();
    docOpBuilder.characters(TEXT + TEXT + TEXT);
    docOpBuilder.elementEnd();
    docOpComplex = new CoreWaveletDocumentOperation(DOC_ID, docOpBuilder.finish());
View Full Code Here


  private static AnnotationBoundaryMap finishAnnotation(String key) {
    return AnnotationBoundaryMapImpl.builder().initializationEnd(key).build();
  }

  private static Attributes attributes(String... attributes) {
    return new AttributesImpl(attributes);
  }
View Full Code Here

* @author ohler@google.com (Christian Ohler)
*/
public class ImmutableStateMapTest extends TestCase {

  public void testRemovalInUpdateWith() {
    assertFalse(new AttributesImpl("a", "1").updateWith(
        new AttributesUpdateImpl("a", "1", null)).containsKey("a"));
  }
View Full Code Here

    assertFalse(new AttributesImpl("a", "1").updateWith(
        new AttributesUpdateImpl("a", "1", null)).containsKey("a"));
  }

  public void testVarargsConstructor() {
    Attributes a = new AttributesImpl("c", "0", "a", "1", "b", "2");
    Map<String, String> m = new HashMap<String, String>();
    m.put("a", "1");
    m.put("b", "2");
    m.put("c", "0");
    assertEquals(new AttributesImpl(m), a);
  }
View Full Code Here

  }

  public void testUpdate() {
    Map<String, String> m = new HashMap<String, String>();
    m.put("a", "0");
    AttributesImpl a = new AttributesImpl(m).updateWith(new AttributesUpdateImpl("b", null, "1"));
    assertEquals("0", a.get("a"));
    assertEquals("1", a.get("b"));
    assertEquals(2, a.size());
  }
View Full Code Here

  }

  public void testAppendLineWithAttributes() {
    getDocWithSchema("");
    LineContainers.appendLine(doc, XmlStringBuilder.createText("hi"),
        new AttributesImpl("t", "h2"));
    assertEquals("h2", doc.getAttribute(DocHelper.getElementWithTagName(doc, "line"), "t"));

    getDocWithSchema("<body><line/>abc</body>");
    LineContainers.appendLine(doc, XmlStringBuilder.createText("hi"),
        new AttributesImpl("id", "2", "t", "h2"));
    assertEquals("h2", doc.getAttribute(DocHelper.findElementById(doc, "2"), "t"));
  }
View Full Code Here

    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());
  }
View Full Code Here

    // do likewise with B
    cursorA = new DocOpBuffer();
    cursorB = new DocOpBuffer();
    DomOperationUtil.buildDomInitializationFromElement(data.D, data.B.asElement(), cursorA, false);
    cursorB.elementStart("b", new AttributesImpl(Collections.singletonMap("x", "y")));
    cursorB.elementEnd();

    checkCursors(cursorA, cursorB);
  }
View Full Code Here

    Bundle data = new Bundle();
    DocOpBuffer cursorA = new DocOpBuffer(), cursorB = new DocOpBuffer();
    DomOperationUtil.buildDomInitializationFromElement(data.D, data.A.asElement(), cursorA, true);
    cursorB.elementStart("a", Attributes.EMPTY_MAP);
    cursorB.characters("child");
    cursorB.elementStart("b", new AttributesImpl(Collections.singletonMap("x", "y")));
    cursorB.elementEnd();
    cursorB.elementEnd();

    checkCursors(cursorA, cursorB);
  }
View Full Code Here

      {
        updateAttributes(new AttributesUpdateImpl("a", null, "2"));
        deleteCharacters("hi t");
        characters("you ");
        retain(4);
        replaceAttributes(new AttributesImpl("a", "1"), new AttributesImpl("b", "2"));
        retain("<some>markup&".length() + 1);
        updateAttributes(new AttributesUpdateImpl("a", "2", "3"));
        retain(2);
        annotationBoundary(AnnotationBoundaryMapImpl.builder().updateValues(
            "link", "12?\"\\3", "blah").build());
View Full Code Here

TOP

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

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.