Package org.odftoolkit.simple

Examples of org.odftoolkit.simple.TextDocument


      j += nodeList.getLength();
      Assert.assertEquals(j, i);
      doc.save(ResourceUtilities.newTestOutputFile(SAVE_FILE_REPLACE));
     
      //validate
      TextDocument doc1 = (TextDocument) Document.loadDocument(ResourceUtilities.getAbsolutePath(SAVE_FILE_REPLACE));
      OdfContentDom contentDom1 = doc1.getContentDom();
     
      nodeList = contentDom1.getElementsByTagName(TextPageNumberElement.ELEMENT_NAME.getQName());
      for(int k =0;k<nodeList.getLength();k++){
        Node nv = nodeList.item(k);
        NamedNodeMap nameMap = nv.getAttributes();
View Full Code Here


     
      //save
      doc.save(ResourceUtilities.newTestOutputFile(SAVE_FILE_REPLACE));
     
      //validate
      TextDocument doc1 = (TextDocument) Document.loadDocument(ResourceUtilities.getAbsolutePath(SAVE_FILE_REPLACE));
      OdfContentDom contentDom1 = doc1.getContentDom();
     
      nodeList = contentDom1.getElementsByTagName(TextPageNumberElement.ELEMENT_NAME.getQName());
      for(int k =0;k<nodeList.getLength();k++){
        Node nv = nodeList.item(k);
        NamedNodeMap nameMap = nv.getAttributes();
View Full Code Here

     
      //save
      doc.save(ResourceUtilities.newTestOutputFile(SAVE_FILE_REPLACE));
     
      //validate
      TextDocument doc1 = (TextDocument) Document.loadDocument(ResourceUtilities.getAbsolutePath(SAVE_FILE_REPLACE));
      OdfContentDom contentDom1 = doc1.getContentDom();
     
      nodeList = contentDom1.getElementsByTagName(TextPageNumberElement.ELEMENT_NAME.getQName());
      for(int k =0;k<nodeList.getLength();k++){
        Node nv = nodeList.item(k);
        NamedNodeMap nameMap = nv.getAttributes();
View Full Code Here

     
      //save
      doc.save(ResourceUtilities.newTestOutputFile(SAVE_FILE_REPLACE));

      //validate 
      TextDocument doc1 = (TextDocument) Document.loadDocument(ResourceUtilities.getAbsolutePath(SAVE_FILE_REPLACE));
     
      search = new TextNavigation("ReplaceDateTarget", doc1);
      if (search.hasNext()) {
        Assert.fail();
      }
View Full Code Here

     
      //save
      doc.save(ResourceUtilities.newTestOutputFile(SAVE_FILE_REPLACE));

      //validate 
      TextDocument doc1 = (TextDocument) Document.loadDocument(ResourceUtilities.getAbsolutePath(SAVE_FILE_REPLACE));
      TextNavigation search4 = new TextNavigation("ReplaceDateTargetchange", doc1);
      int resultcount = 0;
      while (search4.hasNext()) {
        TextSelection item = (TextSelection) search4.nextSelection();
        item.getText();
View Full Code Here

      //save
      doc.save(ResourceUtilities.newTestOutputFile(SAVE_FILE_REPLACE));

      //validate 
      TextDocument doc1 = (TextDocument) Document.loadDocument(ResourceUtilities.getAbsolutePath(SAVE_FILE_REPLACE));
      TextNavigation search4 = new TextNavigation("changeReplaceDateTarget", doc1);
      int resultcount = 0;
      while (search4.hasNext()) {
        TextSelection item = (TextSelection) search4.nextSelection();
        item.getText();
View Full Code Here

  private static final Logger LOGGER =  Logger.getLogger(ParagraphStyleHandlerTest.class.getName());

  @Test
  public void testGetParagraphByIndex() {
    try {
      TextDocument doc = TextDocument.newTextDocument();
      Paragraph paragraph = doc.addParagraph("paragraphTest");
      ParagraphStyleHandler paragraphHandler = paragraph.getStyleHandler();
     
      paragraphHandler.setCountry("English", Document.ScriptType.WESTERN);
     
      //validate
View Full Code Here

 
 
  @Test
  public void testGetFont() {
    try {
      TextDocument doc = TextDocument.newTextDocument();
      Paragraph paragraph = doc.addParagraph("paragraphTest");
      ParagraphStyleHandler paragraphHandler = paragraph.getStyleHandler();
     
      Font fontBase = new Font("Arial", FontStyle.ITALIC, 10, Color.BLACK, TextLinePosition.THROUGH);
      paragraphHandler.setFont(fontBase);
      //validate
View Full Code Here

     
      //save
      doc.save(ResourceUtilities.newTestOutputFile(SAVE_FILE_REPLACE));

      //validate 
      TextDocument doc1 = (TextDocument) Document.loadDocument(ResourceUtilities.getAbsolutePath(SAVE_FILE_REPLACE));
     
      TextNavigation searchafter = new TextNavigation("ReplaceDateTarget", doc1);
      if (searchafter.hasNext()) {
        Assert.fail();
      }
View Full Code Here

 
 
  @Test
  public void testGetLanguage() {
    try {
      TextDocument doc = TextDocument.newTextDocument();
      Paragraph paragraph = doc.addParagraph("paragraphTest");
      ParagraphStyleHandler paragraphHandler = paragraph.getStyleHandler();
     
      paragraphHandler.setLanguage("English", Document.ScriptType.WESTERN);
     
      //validate
View Full Code Here

TOP

Related Classes of org.odftoolkit.simple.TextDocument

Copyright © 2018 www.massapicom. 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.