Footer extends Component implements TableContainer, VariableContainer { public Table addTable() { Table table = getTableContainerImpl().addTable(); updateTableToNone(table); return table; } Footer(StyleFooterElement element); StyleFooterElement 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 testAddTable() { try { TextDocument doc = TextDocument.newTextDocument(); Footer footer = doc.getFooter(); Assert.assertNotNull(footer); Table table = footer.addTable(1, 1); table.setTableName("footerTable"); int rowCount = table.getRowCount(); int columnCount = table.getColumnCount(); String expectedCellValue = "footer table cell"; Cell cellByPosition = table.getCellByPosition(0, 0); cellByPosition.setStringValue(expectedCellValue); cellByPosition.setHorizontalAlignment(HorizontalAlignmentType.CENTER); cellByPosition.setCellBackgroundColor(Color.GREEN); footer = doc.getFooter(true); Assert.assertNotNull(footer); table = footer.addTable(1, 2); table.setTableName("footerFTable"); doc.save(ResourceUtilities.newTestOutputFile(footerDocumentPath)); doc = TextDocument.loadDocument(ResourceUtilities.getTestResourceAsStream(footerDocumentPath)); footer = doc.getFooter(); table = footer.getTableByName("footerTable"); Assert.assertEquals(rowCount, table.getRowCount()); Assert.assertEquals(columnCount, table.getColumnCount()); Assert.assertEquals(expectedCellValue, cellByPosition.getStringValue()); footer = doc.getFooter(true); table = footer.getTableByName("footerFTable"); Assert.assertNotNull(table); } catch (Exception e) { Logger.getLogger(FooterTest.class.getName()).log(Level.SEVERE, null, e); Assert.fail(e.getMessage()); } }
@Test public void testAddtable() { try { TextDocument doc = TextDocument.newTextDocument(); Footer footer = doc.getFooter(); Table tab = footer.addTable(); Assert.assertNotNull(tab); Assert.assertTrue(2 == tab.getRowCount()); Assert.assertTrue(5 == tab.getColumnCount()); TableTableElement tabEle = tab.getOdfElement(); System.out.println(tabEle); } catch (Exception e) { Logger.getLogger(FooterTest.class.getName()).log(Level.SEVERE, null, e); Assert.fail(e.getMessage()); } }