Package org.odftoolkit.odfdom.incubator.doc.text

Examples of org.odftoolkit.odfdom.incubator.doc.text.OdfTextParagraph.appendChild()


    TableTableRowElement row = (TableTableRowElement) mytable.appendChild(new TableTableRowElement(odt));
    TableTableCellElement cell = (TableTableCellElement) row.appendChild(new TableTableCellElement(odt));

    OdfTextParagraph p = new OdfTextParagraph(odt);
    p.appendChild(odt.createTextNode("Corvette"));
    cell.appendChild(p);

    // 2nd Table
    TableTableElement my2table = new TableTableElement(odt);
View Full Code Here


    TableTableRowElement row2 = (TableTableRowElement) my2table.appendChild(new TableTableRowElement(odt));
    TableTableCellElement cell2 = (TableTableCellElement) row2.appendChild(new TableTableCellElement(odt));

    OdfTextParagraph p2 = new OdfTextParagraph(odt);
    p2.appendChild(odt.createTextNode("Bandit 600"));
    cell2.appendChild(p2);

    mysheet.save(ResourceUtilities.getTestOutput(TEST_FILE_SAVE_2TABLES_OUT));
  }
}
View Full Code Here

      TableTableRowElement tr = (TableTableRowElement) table.appendChild(
          doc.newOdfElement(TableTableRowElement.class));
      TableTableCellElement td1 = (TableTableCellElement) tr.appendChild(
          doc.newOdfElement(TableTableCellElement.class));
      OdfTextParagraph p1 = doc.newOdfElement(OdfTextParagraph.class);
      p1.appendChild(doc.createTextNode("content 1"));
      td1.appendChild(p1);

      TableTableCellElement td2 = (TableTableCellElement) tr.appendChild(
          doc.newOdfElement(TableTableCellElement.class));
      OdfTextParagraph p2 = doc.newOdfElement(OdfTextParagraph.class);
View Full Code Here

      td1.appendChild(p1);

      TableTableCellElement td2 = (TableTableCellElement) tr.appendChild(
          doc.newOdfElement(TableTableCellElement.class));
      OdfTextParagraph p2 = doc.newOdfElement(OdfTextParagraph.class);
      p2.appendChild(doc.createTextNode("cell 2"));
      td2.appendChild(p2);

      TableTableCellElement td3 = (TableTableCellElement) tr.appendChild(
          doc.newOdfElement(TableTableCellElement.class));
      OdfTextParagraph p3 = doc.newOdfElement(OdfTextParagraph.class);
View Full Code Here

      td2.appendChild(p2);

      TableTableCellElement td3 = (TableTableCellElement) tr.appendChild(
          doc.newOdfElement(TableTableCellElement.class));
      OdfTextParagraph p3 = doc.newOdfElement(OdfTextParagraph.class);
      p3.appendChild(doc.createTextNode("table cell content 3"));
      td3.appendChild(p3);

      p0.getParentNode().insertBefore(table, p0);

      table.setProperty(StyleTablePropertiesElement.Width, "12cm");
View Full Code Here

            p.setAttributeNS("http://myAttributeNamespace", "my:attr", "attrValue");
            String resAttr1 = xpath.evaluate("//*[@my:attr = 'attrValue']", contentDom);
            Assert.assertTrue(resAttr1 != null);

            // Test XPath on none ODF element (added explicitly via DOM)
            p.appendChild(contentDom.createElementNS("http://myElementNamespace", "my:element"));
            String resElement1 = xpath.evaluate("//my:element", contentDom);
            Assert.assertTrue(resElement1 != null);

            // Save documnet
            File targetFile = ResourceUtilities.newTestOutputFile(TARGET);
View Full Code Here

            // Test XPath on none ODF attributes (added via load)
            String resAttr2 = xpath.evaluate("//*[@my:attr = 'attrValue']", contentDomReloaded);
            Assert.assertTrue(resAttr2 != null);

            // Test XPath on none ODF element (added via load)
            p.appendChild(contentDom.createElementNS("http://myElementNamespace", "my:element"));
            String resElement2 = xpath.evaluate("//my:element", contentDomReloaded);
            Assert.assertTrue(resElement2 != null);

        } catch (Exception ex) {
          Logger.getLogger(NamespaceTest.class.getName()).log(Level.SEVERE, ex.getMessage(), ex);
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.