Examples of appendChild()


Examples of org.odftoolkit.odfdom.dom.element.draw.DrawPageElement.appendChild()

        lastPara.appendChild(drawFrame);
        drawFrame.setTextAnchorTypeAttribute(TextAnchorTypeAttribute.Value.PARAGRAPH.toString());
      } else if (this instanceof PresentationDocument) {
        DrawPageElement lastPage = (DrawPageElement) xpath.evaluate("//draw:page[last()]", contentDom,
            XPathConstants.NODE);
        lastPage.appendChild(drawFrame);
      }
      OdfDrawImage image = (OdfDrawImage) drawFrame.newDrawImageElement();
      String imagePath = image.newImage(imageUri);
      return imagePath;
    } catch (Exception ex) {
View Full Code Here

Examples of org.odftoolkit.odfdom.dom.element.number.NumberCurrencySymbolElement.appendChild()

    OdfFileDom dom = (OdfFileDom) this.getOwnerDocument();
    int currencyPos = text.indexOf(currencySymbol);
    if (currencyPos >= 0) {
      emitText(text.substring(0, currencyPos));
      NumberCurrencySymbolElement cSymbol = new NumberCurrencySymbolElement(dom);
      cSymbol.appendChild(dom.createTextNode(currencySymbol));
      this.appendChild(cSymbol);
      emitText(text.substring(currencyPos + currencySymbol.length()));
    } else {
      emitText(text);
    }
View Full Code Here

Examples of org.odftoolkit.odfdom.dom.element.office.OfficeBodyElement.appendChild()

      OfficeBodyElement body = contentDom.newOdfElement(OfficeBodyElement.class);
      content.appendChild(body);
      ChartChartElement chart = contentDom.newOdfElement(ChartChartElement.class);
      //create children element
      ChartPlotAreaElement plotArea = chart.newChartPlotAreaElement();
      body.appendChild(chart);
      p0.getParentNode().insertBefore(content, p0);


      XPath xpath = contentDom.getXPath();
      ChartChartElement chartTest = (ChartChartElement) xpath.evaluate("//chart:chart[last()]", contentDom, XPathConstants.NODE);
View Full Code Here

Examples of org.odftoolkit.odfdom.dom.element.office.OfficeDocumentContentElement.appendChild()

      Assert.assertTrue(lst.getLength() > 0);
      OdfTextParagraph p0 = (OdfTextParagraph) lst.item(lst.getLength() - 1);

      OfficeDocumentContentElement content = contentDom.newOdfElement(OfficeDocumentContentElement.class);
      OfficeBodyElement body = contentDom.newOdfElement(OfficeBodyElement.class);
      content.appendChild(body);
      ChartChartElement chart = contentDom.newOdfElement(ChartChartElement.class);
      //create children element
      ChartPlotAreaElement plotArea = chart.newChartPlotAreaElement();
      body.appendChild(chart);
      p0.getParentNode().insertBefore(content, p0);
View Full Code Here

Examples of org.odftoolkit.odfdom.dom.element.office.OfficeDocumentMetaElement.appendChild()

    OfficeDocumentMetaElement rootElement = this.getRootElement();
    if(rootElement == null){   
      rootElement = new OfficeDocumentMetaElement(this);
      this.appendChild(rootElement);
      OfficeMetaElement officeMetaElement = new OfficeMetaElement(this);
      rootElement.appendChild(officeMetaElement);
    }
  }

  /** Might be used to initialize specific XML Namespace prefixes/URIs for this XML file*/
  @Override
 
View Full Code Here

Examples of org.odftoolkit.odfdom.dom.element.office.OfficePresentationElement.appendChild()

    }
    DrawPageElement sourceSlideElement = (DrawPageElement) slideList.item(source);
    DrawPageElement cloneSlideElement = (DrawPageElement) sourceSlideElement.cloneNode(true);
    cloneSlideElement.setDrawNameAttribute(newName);
    if (dest == slideCount) {
      contentRoot.appendChild(cloneSlideElement);
    } else {
      DrawPageElement refSlide = (DrawPageElement) slideList.item(dest);
      contentRoot.insertBefore(cloneSlideElement, refSlide);
    }
    adjustNotePageNumber(Math.min(source, dest));
View Full Code Here

Examples of org.odftoolkit.odfdom.dom.element.office.OfficeSpreadsheetElement.appendChild()

      {
        myTable = (TableTableElement) tableList.item(i);
      } else { //table with the specific table name is not found. Create table
        myTable = dom.newOdfElement(TableTableElement.class);
        myTable.setTableNameAttribute(tablename);
        spreadsheet.appendChild(myTable);
      }

      lst = myTable.getElementsByTagNameNS(OdfDocumentNamespace.TABLE.getUri(), "table-row");
      if (lst.getLength() == 0) { //the first table row is not existed. Create table row
        td = dom.newOdfElement(TableTableRowElement.class);
View Full Code Here

Examples of org.odftoolkit.odfdom.dom.element.office.OfficeTextElement.appendChild()

        newSectionEle = (TextSectionElement) cloneForeignElement(newSectionEle, getContentDom(), true);

      updateNames(newSectionEle);
      updateXMLIds(newSectionEle);
      OfficeTextElement contentRoot = getContentRoot();
      contentRoot.appendChild(newSectionEle);
      return Section.getInstance(newSectionEle);
    } catch (Exception e) {
      Logger.getLogger(TextDocument.class.getName()).log(Level.SEVERE, null, e);
    }
    return null;
View Full Code Here

Examples of org.odftoolkit.odfdom.dom.element.style.StyleTabStopsElement.appendChild()

            StyleTabStopsElement tabStops = (StyleTabStopsElement) OdfXMLFactory.newOdfElement(dom, StyleTabStopsElement.ELEMENT_NAME);
            StyleTabStopElement tabStop1 = (StyleTabStopElement) OdfXMLFactory.newOdfElement(dom, StyleTabStopElement.ELEMENT_NAME);
            StyleTabStopElement tabStop2 = (StyleTabStopElement) OdfXMLFactory.newOdfElement(dom, StyleTabStopElement.ELEMENT_NAME);
            OdfStylePropertiesBase propElement = style1.getPropertiesElement(OdfStylePropertiesSet.ParagraphProperties);
            propElement.appendChild(tabStops);
            tabStops.appendChild(tabStop1);
            tabStops.appendChild(tabStop2);
            StyleBackgroundImageElement img = (StyleBackgroundImageElement) OdfXMLFactory.newOdfElement(dom, StyleBackgroundImageElement.ELEMENT_NAME);
            propElement = style2.getPropertiesElement(OdfStylePropertiesSet.ParagraphProperties);
            propElement.appendChild(img);
            Assert.assertTrue(style2.compareTo(style1) < 0);
View Full Code Here

Examples of org.odftoolkit.odfdom.dom.element.table.TableTableCellElement.appendChild()

      OdfDrawFrame drawFrame = contentDom.newOdfElement(OdfDrawFrame.class);
      XPath xpath = contentDom.getXPath();
      if (this instanceof SpreadsheetDocument) {
        TableTableCellElement lastCell = (TableTableCellElement) xpath.evaluate("//table:table-cell[last()]",
            contentDom, XPathConstants.NODE);
        lastCell.appendChild(drawFrame);
        drawFrame.removeAttribute("text:anchor-type");

      } else if (this instanceof TextDocument) {
        TextPElement lastPara = (TextPElement) xpath.evaluate("//text:p[last()]", contentDom,
            XPathConstants.NODE);
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.