Package org.odftoolkit.simple

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


      tablelist = dom.getElementsByTagNameNS(OdfDocumentNamespace.TABLE.getUri(), "table");
      for (int i = 0; i < tablelist.getLength(); i++) {
        mOdtTable = (TableTableElement) tablelist.item(i);
        testAppendRow(mOdtTable);
      }
      odtDoc.save(ResourceUtilities.newTestOutputFile("TestODTAppendRowOutput.odt"));

    } catch (Exception e) {
      Logger.getLogger(TableTest.class.getName()).log(Level.SEVERE, null, e);
      Assert.fail(e.getMessage());
    }
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

          SupportedLinearMeasure.IN));
      Assert.assertEquals(3.0, find.getRectangle().getWidth());
      Assert.assertEquals(0.5, find.getRectangle().getHeight());
      Assert.assertEquals(5.0, find.getRectangle().getY());
      Assert.assertEquals(2.2546, find.getRectangle().getX());
      textDoc.save(ResourceUtilities
          .newTestOutputFile("TestSetRadioButtonRectangle.odt"));
    } catch (Exception e) {
      Logger.getLogger(RadioButtonTest.class.getName()).log(Level.SEVERE,
          null, e);
    }
View Full Code Here

      Assert.assertEquals(HorizontalRelative.PARAGRAPH,
          graphicPropertiesForWrite.getHorizontalRelative());
      Assert.assertEquals(FrameHorizontalPosition.CENTER,
          graphicPropertiesForWrite.getHorizontalPosition());

      textDoc.save(ResourceUtilities
          .newTestOutputFile("TestSetRadioButtonAnchorType.odt"));
    } catch (Exception e) {
      Logger.getLogger(RadioButtonTest.class.getName()).log(Level.SEVERE,
          null, e);
    }
View Full Code Here

      Assert.assertEquals(newLabel, find.getLabel());
      // set null value
      find.setLabel(null);
      Assert.assertEquals("", find.getLabel());

      textDoc.save(ResourceUtilities
          .newTestOutputFile("TestSetRadioButtonLabel.odt"));
    } catch (Exception e) {
      Logger.getLogger(RadioButtonTest.class.getName()).log(Level.SEVERE,
          null, e);
    }
View Full Code Here

      Assert.assertEquals(true, find.getCurrentSelected());

      find.setCurrentSelected(false);
      Assert.assertEquals(false, find.getCurrentSelected());

      textDoc.save(ResourceUtilities
          .newTestOutputFile("TestSetRadioButtonState.odt"));
    } catch (Exception e) {
      Logger.getLogger(RadioButtonTest.class.getName()).log(Level.SEVERE,
          null, e);
    }
View Full Code Here

      Assert.assertEquals("1", find.getValue());

      find.setValue("15");
      Assert.assertEquals("15", find.getValue());

      textDoc.save(ResourceUtilities
          .newTestOutputFile("TestSetRadioButtonValue.odt"));
    } catch (Exception e) {
      Logger.getLogger(RadioButtonTest.class.getName()).log(Level.SEVERE,
          null, e);
    }
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.