Examples of OdfTextParagraph


Examples of org.odftoolkit.odfdom.incubator.doc.text.OdfTextParagraph

    LOG.info("addStyleSpan");
    String content = "heading content";
    String spanContent = "span content";
    String styleName = "testStyle";
    String spanStyleName = "spanStyle";
    OdfTextParagraph instance = new OdfTextParagraph(dom);
    OdfTextSpan subElement;
    Node node;
    Assert.assertNotNull(instance);
    instance.addStyledContent(styleName, content).addStyledSpan(
      spanStyleName, spanContent);

    // first item should be text
    node = instance.getFirstChild();
    Assert.assertNotNull(node);
    Assert.assertEquals(Node.TEXT_NODE, node.getNodeType());
    Assert.assertEquals(node.getTextContent(), content);
    Assert.assertEquals(instance.getStyleName(), styleName);

    // followed by a span
    node = node.getNextSibling();
    Assert.assertNotNull(node);
    Assert.assertEquals(Node.ELEMENT_NODE, node.getNodeType());
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.