Package org.odftoolkit.odfdom.dom.element.text

Examples of org.odftoolkit.odfdom.dom.element.text.TextChapterElement


    try {
      TextDocument doc = TextDocument.loadDocument(ResourceUtilities.getTestResourceAsStream(TEST_DOCUMENT));
      ChapterField chapterField = Fields.createChapterField(doc.addParagraph("Chapter:").getOdfElement());
      chapterField.setOutlineLevel(1);
     
      TextChapterElement tchapterele = chapterField.getOdfElement();
      Integer level = tchapterele.getTextOutlineLevelAttribute();
      Assert.assertTrue(1 == level);
     
      //save
      //doc.save(ResourceUtilities.getAbsolutePath(TEST_DOCUMENT));
    } catch (Exception e) {
View Full Code Here


  public void testGetOdfElement() {
    try {
      TextDocument doc = TextDocument.loadDocument(ResourceUtilities.getTestResourceAsStream("headerFooterHidden.odt"));
      ChapterField chapterField = Fields.createChapterField(doc.addParagraph("Chapter:").getOdfElement());
      chapterField.setOutlineLevel(1);
      TextChapterElement tchapterEle = chapterField.getOdfElement();
     
      Assert.assertNotNull(tchapterEle);
      Assert.assertEquals("chapter", tchapterEle.getLocalName());
      Assert.assertEquals("text:chapter", tchapterEle.getNodeName());

      //save
      //doc.save(ResourceUtilities.getAbsolutePath("TextFieldSampleDocument.odt"));
     
    } catch (Exception e) {
View Full Code Here

TOP

Related Classes of org.odftoolkit.odfdom.dom.element.text.TextChapterElement

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.