ChapterField extends Field { public void setOutlineLevel(int level) { chapterElement.setTextOutlineLevelAttribute(level); } ChapterField(OdfElement odfElement); void setDisplayPage(DisplayType type); void setOutlineLevel(int level); TextChapterElement getOdfElement(); @Override FieldType getFieldType();  }
@Test public void testSetOutlineLevel() { 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); } catch (Exception e) { Logger.getLogger(ChapterFieldTest.class.getName()).log(Level.SEVERE, null, e); Assert.fail(e.getMessage()); } }