Package org.odftoolkit.odfdom.pkg

Examples of org.odftoolkit.odfdom.pkg.OdfElement.appendChild()


      }

      if (deep) {
        Node childNode = element.getFirstChild();
        while (childNode != null) {
          cloneElement.appendChild(cloneForeignElement(childNode, dom, true));
          childNode = childNode.getNextSibling();
        }
      }

      return cloneElement;
View Full Code Here


    try {
      OdfElement parent = container.getFrameContainerElement();
      OdfFileDom ownerDom = (OdfFileDom) parent.getOwnerDocument();
      DrawFrameElement fElement = ownerDom.newOdfElement(DrawFrameElement.class);
      parent.appendChild(fElement);
      DrawImageElement imageElement = fElement.newDrawImageElement();
      // set uri and copy resource
      String packagePath = insertImageResourceIntoPackage((OdfSchemaDocument) ownerDom.getDocument(), uri);
      packagePath = packagePath.replaceFirst(ownerDom.getDocument().getDocumentPath(), "");
      URI newURI = configureInsertedImage((OdfSchemaDocument) ownerDom.getDocument(), imageElement, packagePath,
View Full Code Here

  public static Paragraph newParagraph(ParagraphContainer container) {
    Paragraph para = null;
    OdfElement parent = container.getParagraphContainerElement();
    OdfFileDom ownerDom = (OdfFileDom) parent.getOwnerDocument();
    TextPElement pEle = ownerDom.newOdfElement(TextPElement.class);
    parent.appendChild(pEle);
    para = new Paragraph(pEle);
    Component.registerComponent(para, pEle);

    return para;
  }
View Full Code Here

  public static Paragraph newParagraph(ParagraphContainer container) {
    Paragraph para = null;
    OdfElement parent = container.getParagraphContainerElement();
    OdfFileDom ownerDom = (OdfFileDom) parent.getOwnerDocument();
    TextPElement pEle = ownerDom.newOdfElement(TextPElement.class);
    parent.appendChild(pEle);
    para = new Paragraph(pEle);
    Component.registerComponent(para, pEle);

    return para;
  }
View Full Code Here

      }

      if (deep) {
        Node childNode = element.getFirstChild();
        while (childNode != null) {
          cloneElement.appendChild(cloneForeignElement(childNode, dom, true));
          childNode = childNode.getNextSibling();
        }
      }

      return cloneElement;
View Full Code Here

      //4. append to the end of document
      OdfElement root = document.getContentDom().getRootElement();
      OfficeBodyElement officeBody = OdfElement.findFirstChildNode(OfficeBodyElement.class, root);
      OdfElement typedContent = OdfElement.findFirstChildNode(OdfElement.class, officeBody);
      typedContent.appendChild(newTEle);

      return OdfTable.getInstance(newTEle);

    } catch (DOMException e) {
      Logger.getLogger(OdfTable.class.getName()).log(Level.SEVERE, e.getMessage(), e);
View Full Code Here

      //4. append to the end of document
      OdfElement root = document.getContentDom().getRootElement();
      OfficeBodyElement officeBody = OdfElement.findFirstChildNode(OfficeBodyElement.class, root);
      OdfElement typedContent = OdfElement.findFirstChildNode(OdfElement.class, officeBody);
      typedContent.appendChild(newTEle);

      return OdfTable.getInstance(newTEle);
   
    } catch (Exception e) {
      Logger.getLogger(OdfTable.class.getName()).log(Level.SEVERE, e.getMessage(), e);
View Full Code Here

      //4. append to the end of document
      OdfElement root = document.getContentDom().getRootElement();
      OfficeBodyElement officeBody = OdfElement.findFirstChildNode(OfficeBodyElement.class, root);
      OdfElement typedContent = OdfElement.findFirstChildNode(OdfElement.class, officeBody);
      typedContent.appendChild(newTEle);

      return OdfTable.getInstance(newTEle);

    } catch (DOMException e) {
      Logger.getLogger(OdfTable.class.getName()).log(Level.SEVERE, e.getMessage(), e);
View Full Code Here

      //4. append to the end of document
      OdfElement root = document.getContentDom().getRootElement();
      OfficeBodyElement officeBody = OdfElement.findFirstChildNode(OfficeBodyElement.class, root);
      OdfElement typedContent = OdfElement.findFirstChildNode(OdfElement.class, officeBody);
      typedContent.appendChild(newTEle);

      OdfTable table = OdfTable.getInstance(newTEle);
      List<OdfTableRow> rowList = table.getRowList();
      for (int i = 0; i < rowNumber + rowHeaders; i++) {
        OdfTableRow row = rowList.get(i);
View Full Code Here

      //4. append to the end of document
      OdfElement root = document.getContentDom().getRootElement();
      OfficeBodyElement officeBody = OdfElement.findFirstChildNode(OfficeBodyElement.class, root);
      OdfElement typedContent = OdfElement.findFirstChildNode(OdfElement.class, officeBody);
      typedContent.appendChild(newTEle);

      OdfTable table = OdfTable.getInstance(newTEle);
      List<OdfTableRow> rowList = table.getRowList();
      for (int i = 0; i < rowNumber + rowHeaders; i++) {
        OdfTableRow row = rowList.get(i);
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.