Header extends Component implements TableContainer, VariableContainer { public OdfElement getVariableContainerElement() { return getVariableContainerImpl().getVariableContainerElement(); } Header(StyleHeaderElement element); StyleHeaderElement getOdfElement(); boolean isVisible(); void setVisible(boolean isVisible); Table addTable(); Table addTable(int numRows, int numCols); Table getTableByName(String name); java.util.List<Table> getTableList(); TableBuilder getTableBuilder(); OdfElement getTableContainerElement(); OdfElement getVariableContainerElement(); VariableField declareVariable(String name, VariableType type); VariableField getVariableFieldByName(String name); Section appendSection(String name);  }
@Test public void testGetVariableContainerElement() { try { TextDocument doc = TextDocument.newTextDocument(); Header header = doc.getHeader(); OdfElement odfEle = header.getVariableContainerElement(); TableBuilder tb = header.getTableBuilder(); Table tab = tb.newTable(); Assert.assertNotNull(tab); Assert.assertTrue(2 == tab.getRowCount()); Assert.assertTrue(5 == tab.getColumnCount()); Node nod = odfEle.getFirstChild(); Assert.assertEquals("table:table", nod.getNodeName()); doc.save(ResourceUtilities.newTestOutputFile("headerTableOutput.odt")); } catch (Exception e) { Logger.getLogger(HeaderTest.class.getName()).log(Level.SEVERE, null, e); Assert.fail(e.getMessage()); } }