Package org.odftoolkit.odfdom.dom.element.table

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


        for (int j = 0; j < numCols; j++) {
          TableTableCellElement aCell = (TableTableCellElement) OdfXMLFactory.newOdfElement(dom,
              OdfName.newName(OdfDocumentNamespace.TABLE, "table-cell"));
          TextPElement aParagraph = (TextPElement) OdfXMLFactory.newOdfElement(dom,
              OdfName.newName(OdfDocumentNamespace.TEXT, "p"));
          aCell.appendChild(aParagraph);
          if (!isSpreadsheet) {
            if ((j + 1 == numCols) && (i == 0)) {
              aCell.setStyleName(righttopStyle.getStyleNameAttribute());
            } else if (i == 0) {
              aCell.setStyleName(lefttopStyle.getStyleNameAttribute());
View Full Code Here

      for (int j = 0; j < numCols; j++) {
        TableTableCellElement aCell = (TableTableCellElement) OdfXMLFactory.newOdfElement(dom,
            OdfName.newName(OdfDocumentNamespace.TABLE, "table-cell"));
        TextPElement aParagraph = (TextPElement) OdfXMLFactory.newOdfElement(dom,
            OdfName.newName(OdfDocumentNamespace.TEXT, "p"));
        aCell.appendChild(aParagraph);
        if (!isSpreadsheet) {
          if ((j + 1 == numCols) && (i == 0)) {
            aCell.setStyleName(righttopStyle.getStyleNameAttribute());
          } else if (i == 0) {
            aCell.setStyleName(lefttopStyle.getStyleNameAttribute());
View Full Code Here

    for (int j = 0; j < columnCount; j++) {
      TableTableCellElement aCell = (TableTableCellElement) OdfXMLFactory.newOdfElement(dom,
          OdfName.newName(OdfDocumentNamespace.TABLE, "table-cell"));
      TextPElement aParagraph = (TextPElement) OdfXMLFactory.newOdfElement(dom,
          OdfName.newName(OdfDocumentNamespace.TEXT, "p"));
      aCell.appendChild(aParagraph);
      if (!mIsSpreadsheet) {
        if (j + 1 == columnCount) {
          aCell.setStyleName(righttopStyle.getStyleNameAttribute());
        } else {
          aCell.setStyleName(lefttopStyle.getStyleNameAttribute());
View Full Code Here

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

      } else if (this instanceof OdfTextDocument) {
        TextPElement lastPara = (TextPElement) xpath.evaluate("//text:p[last()]", contentDom, XPathConstants.NODE);
        if (lastPara == null) {
View Full Code Here

          p.setTextContent("memory(b)");
        } else {
          p.setTextContent("time(ms)");
        }
        td.appendChild(cell);
        cell.appendChild(p);
        myTable.appendChild(td);
      } else {
        td = (TableTableRowElement) lst.item(0); //the first table row is existed.
      }
      cell = dom.newOdfElement(TableTableCellElement.class);
View Full Code Here

      }
      cell = dom.newOdfElement(TableTableCellElement.class);
      td.appendChild(cell);
      p = dom.newOdfElement(OdfTextParagraph.class);
      p.setTextContent(testTag);
      cell.appendChild(p);


      for (i = 1; i < values.length + 1; i++) {
        if (i < lst.getLength()) { //table row is existed
          td = (TableTableRowElement) lst.item(i);
View Full Code Here

          //append first cell with labels
          cell = dom.newOdfElement(TableTableCellElement.class);
          td.appendChild(cell);
          p = dom.newOdfElement(OdfTextParagraph.class);
          p.setTextContent(labels[j]);
          cell.appendChild(p);
        }
        cell = dom.newOdfElement(TableTableCellElement.class);
        cell.setOfficeValueTypeAttribute("float");
        cell.setOfficeValueAttribute(new Double(values[j]));
        p = dom.newOdfElement(OdfTextParagraph.class);
View Full Code Here

        cell = dom.newOdfElement(TableTableCellElement.class);
        cell.setOfficeValueTypeAttribute("float");
        cell.setOfficeValueAttribute(new Double(values[j]));
        p = dom.newOdfElement(OdfTextParagraph.class);
        p.setTextContent(values[j] + "");
        cell.appendChild(p);
        td.appendChild(cell);
        j++;
      }
    } catch (Exception e) {
      LOG.log(Level.SEVERE, null, e);
View Full Code Here

    protected DrawFrameElement getChartFrame() throws Exception {
      OdfContentDom contentDom2 = sdoc.getContentDom();
      DrawFrameElement drawFrame = contentDom2.newOdfElement(DrawFrameElement.class);
      TableTableCellElement lastCell = (TableTableCellElement) contentDom2.getXPath().evaluate(
          "//table:table-cell[last()]", contentDom2, XPathConstants.NODE);
      lastCell.appendChild(drawFrame);
      drawFrame.removeAttribute("text:anchor-type");
      this.drawFrame = drawFrame;
      return drawFrame;
    }
   
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.