Package org.odftoolkit.simple

Examples of org.odftoolkit.simple.TextDocument.save()


      Table swTable = Table.newTable(odt, 1, 5);
      CellRange swCellRange = swTable.getCellRangeByPosition("A1", "E2");
      Cell swCell = swTable.getCellByPosition("E2");
      swCell.setStringValue("Merge A1:E2");
      swCellRange.merge();
      odt.save(ResourceUtilities.newTestOutputFile(odtfilename + "MergeTextExpandCell.odt"));
      swTable = odt.getTableList().get(0);
      Assert.assertTrue(swTable.getColumnCount() == 1);
      Assert.assertTrue(swTable.getRowCount() == 1);
    } catch (Exception ex) {
      Logger.getLogger(TableCellRangeTest.class.getName()).log(Level.SEVERE, ex.getMessage(), ex);
View Full Code Here


      header = doc.getHeader(true);
      Assert.assertNotNull(header);

      table = header.addTable();
      table.setTableName("headerHTable");
      doc.save(ResourceUtilities.newTestOutputFile(headerDocumentPath));
     
      // load the document again.
      doc = TextDocument.loadDocument(ResourceUtilities.getTestResourceAsStream(headerDocumentPath));
      header = doc.getHeader();
      table = header.getTableByName("headerTable");
View Full Code Here

      TextDocument doc = TextDocument.loadDocument(ResourceUtilities.getTestResourceAsStream("headerFooterHidden.odt"));
      Header header = doc.getHeader();
      Assert.assertEquals(true, header.isVisible());
      header.setVisible(false);
      Assert.assertEquals(false, header.isVisible());
      doc.save(ResourceUtilities.newTestOutputFile("headerHiddenOutput.odt"));
    } catch (Exception e) {
      Logger.getLogger(HeaderTest.class.getName()).log(Level.SEVERE, null, e);
      Assert.fail(e.getMessage());
    }
  }
View Full Code Here

      StyleHeaderElement styleheader = header.getOdfElement();
      Assert.assertNotNull(styleheader);
      Assert.assertEquals("header", styleheader.getLocalName());

      //save
      doc.save(ResourceUtilities.newTestOutputFile("headerHiddenOutput.odt"));
    } catch (Exception e) {
      Logger.getLogger(HeaderTest.class.getName()).log(Level.SEVERE, null, e);
      Assert.fail(e.getMessage());
    }
  }
View Full Code Here

      Table tab1 = listTab.get(0);
      Assert.assertNotNull(tab1);
      Assert.assertEquals(tab, tab1);

      //save
      doc.save(ResourceUtilities.newTestOutputFile("headerTableOutput.odt"));
    } catch (Exception e) {
      Logger.getLogger(HeaderTest.class.getName()).log(Level.SEVERE, null, e);
      Assert.fail(e.getMessage());
    }
  }
View Full Code Here

      Table tab1 = listTab.get(0);
      Assert.assertNotNull(tab1);
      Assert.assertEquals(tab, tab1);

      //save
      doc.save(ResourceUtilities.newTestOutputFile("headerTableOutput.odt"));
    } catch (Exception e) {
      Logger.getLogger(HeaderTest.class.getName()).log(Level.SEVERE, null, e);
      Assert.fail(e.getMessage());
    }
  }
View Full Code Here

     
      Node nod = odfEle.getFirstChild();
      Assert.assertEquals("table:table", nod.getNodeName());

      //save
      doc.save(ResourceUtilities.newTestOutputFile("headerTableOutput.odt"));
    } catch (Exception e) {
      Logger.getLogger(HeaderTest.class.getName()).log(Level.SEVERE, null, e);
      Assert.fail(e.getMessage());
    }
  }
View Full Code Here

      NamedNodeMap nameMap = nod.getAttributes();
      Node nodtext = nameMap.getNamedItem("text:name");
      Assert.assertEquals("headername", nodtext.getNodeValue());

      //save
      doc.save(ResourceUtilities.newTestOutputFile("headerTableOutput.odt"));
    } catch (Exception e) {
      Logger.getLogger(HeaderTest.class.getName()).log(Level.SEVERE, null, e);
      Assert.fail(e.getMessage());
    }
  }
View Full Code Here

      NamedNodeMap nameMap = nod.getAttributes();
      Node nodtext = nameMap.getNamedItem("text:name");
      Assert.assertEquals(vName, nodtext.getNodeValue());

      //save
      doc.save(ResourceUtilities.newTestOutputFile("headerTableOutput.odt"));
    } catch (Exception e) {
      Logger.getLogger(HeaderTest.class.getName()).log(Level.SEVERE, null, e);
      Assert.fail(e.getMessage());
    }
  }
View Full Code Here

      //first page
      footer = doc.getFooter(true);
      Assert.assertNotNull(footer);
      table = footer.addTable(1, 2);
      table.setTableName("footerFTable");
      doc.save(ResourceUtilities.newTestOutputFile(footerDocumentPath));

      // load the document again.
      doc = TextDocument.loadDocument(ResourceUtilities.getTestResourceAsStream(footerDocumentPath));
      footer = doc.getFooter();
      table = footer.getTableByName("footerTable");
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.