Examples of TextDocument


Examples of org.odftoolkit.simple.TextDocument

  private static final String TEST_FILE = "CommentBreakHeadingDocument.odt";

  @Test
  public void testAppend() {
    TextDocument doc;
    try {
      doc = TextDocument.newTextDocument();
      int i;
      for (i = 0; i < PLAIN_TEXT.length; i++) {
        Paragraph para = Paragraph.newParagraph(doc);
View Full Code Here

Examples of org.odftoolkit.simple.TextDocument

    }
  }

  @Test
  public void testSetTextContent() {
    TextDocument doc;
    try {
      doc = TextDocument.newTextDocument();
      int i;
      for (i = 0; i < PLAIN_TEXT.length; i++) {
        Paragraph para = Paragraph.newParagraph(doc);
View Full Code Here

Examples of org.odftoolkit.simple.TextDocument

    }
  }

  @Test
  public void testRemoveContent() {
    TextDocument doc;
    try {
      doc = TextDocument.newTextDocument();
      int i;
      for (i = 0; i < PLAIN_TEXT.length; i++) {
        Paragraph para = Paragraph.newParagraph(doc);
View Full Code Here

Examples of org.odftoolkit.simple.TextDocument

  }

  @Test
  public void testGetParagraphByIndex() {
    try {
      TextDocument doc = TextDocument.newTextDocument();
      Paragraph paragraph1 = doc.addParagraph("paragraph1");
      Paragraph paragraphE = doc.addParagraph(null);
      Paragraph paragraph2 = doc.addParagraph("p2");

      Paragraph t1 = doc.getParagraphByIndex(1, false);
      Assert.assertEquals(t1, paragraph1);
      t1 = doc.getParagraphByIndex(3, false);
      Assert.assertEquals(t1, paragraph2);
      t1 = doc.getParagraphByIndex(1, true);
      Assert.assertEquals(t1, paragraph2);
      t1 = doc.getParagraphByReverseIndex(0, false);
      Assert.assertEquals(t1, paragraph2);
      t1 = doc.getParagraphByReverseIndex(2, false);
      Assert.assertEquals(t1, paragraph1);
      t1 = doc.getParagraphByReverseIndex(1, true);
      Assert.assertEquals(t1, paragraph1);
      doc.save(ResourceUtilities.newTestOutputFile("testGetParagraphByIndex.odt"));
    } catch (Exception e) {
      LOGGER.log(Level.SEVERE, e.getMessage(), e);
      Assert.fail(e.getMessage());
    }
  }
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.