Examples of newOdfElement()


Examples of org.odftoolkit.odfdom.pkg.OdfFileDom.newOdfElement()

      for (i = 1; i < values.length + 1; i++) {
        if (i < lst.getLength()) { //table row is existed
          td = (TableTableRowElement) lst.item(i);
        } else { //table row is not existed.
          td = dom.newOdfElement(TableTableRowElement.class);
          myTable.appendChild(td);
          //append first cell with labels
          cell = dom.newOdfElement(TableTableCellElement.class);
          td.appendChild(cell);
          p = dom.newOdfElement(OdfTextParagraph.class);
View Full Code Here

Examples of org.odftoolkit.odfdom.pkg.OdfFileDom.newOdfElement()

          td = (TableTableRowElement) lst.item(i);
        } else { //table row is not existed.
          td = dom.newOdfElement(TableTableRowElement.class);
          myTable.appendChild(td);
          //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);
        }
View Full Code Here

Examples of org.odftoolkit.odfdom.pkg.OdfFileDom.newOdfElement()

          td = dom.newOdfElement(TableTableRowElement.class);
          myTable.appendChild(td);
          //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");
View Full Code Here

Examples of org.odftoolkit.odfdom.pkg.OdfFileDom.newOdfElement()

          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);
        p.setTextContent(values[j] + "");
        cell.appendChild(p);
View Full Code Here

Examples of org.odftoolkit.odfdom.pkg.OdfFileDom.newOdfElement()

          cell.appendChild(p);
        }
        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++;
      }
View Full Code Here

Examples of org.odftoolkit.odfdom.pkg.OdfFileDom.newOdfElement()

   *            the header of this list.
   */
  public List(ListContainer container, String header, ListDecorator decorator) {
    OdfElement containerElement = container.getListContainerElement();
    OdfFileDom ownerDocument = (OdfFileDom) containerElement.getOwnerDocument();
    listElement = ownerDocument.newOdfElement(TextListElement.class);
    listElement.setXmlIdAttribute(getUniqueXMLID());
    containerElement.appendChild(listElement);
    setHeader(header);
    if (decorator == null) {
      Document doc = (Document) ownerDocument.getDocument();
View Full Code Here

Examples of org.odftoolkit.odfdom.pkg.OdfFileDom.newOdfElement()

   * @exception IndexOutOfBoundsException
   *                when the <code>location</code> is out of the List range.
   */
  public ListItem addItem(int location, String itemContent) {
    OdfFileDom ownerDocument = (OdfFileDom) listElement.getOwnerDocument();
    TextListItemElement listItemElement = ownerDocument.newOdfElement(TextListItemElement.class);
    Node refNode = getItemByLocation(location);
    listElement.insertBefore(listItemElement, refNode);
    ListItem item = new ListItem(listItemElement);
    item.setParagraphDecorator(decorator);
    item.setTextContent(itemContent);
View Full Code Here

Examples of org.odftoolkit.odfdom.pkg.OdfFileDom.newOdfElement()

  public java.util.List<ListItem> addItems(int location, String[] items) {
    java.util.List<ListItem> listCollection = new ArrayList<ListItem>();
    OdfFileDom ownerDocument = (OdfFileDom) listElement.getOwnerDocument();
    Node refNode = getItemByLocation(location);
    for (int i = items.length - 1; i >= 0; i--) {
      TextListItemElement listItemElement = ownerDocument.newOdfElement(TextListItemElement.class);
      listElement.insertBefore(listItemElement, refNode);
      ListItem item = new ListItem(listItemElement);
      item.setParagraphDecorator(decorator);
      item.setTextContent(items[i]);
      refNode = listItemElement;
View Full Code Here

Examples of org.odftoolkit.odfdom.pkg.OdfFileDom.newOdfElement()

   * @exception IndexOutOfBoundsException
   *                when the <code>location</code> is out of the List range.
   */
  public ListItem set(int location, String itemContent) {
    OdfFileDom ownerDocument = (OdfFileDom) listElement.getOwnerDocument();
    TextListItemElement listItemElement = ownerDocument.newOdfElement(TextListItemElement.class);
    Node oldNode = getItemByLocation(location);
    listElement.replaceChild(listItemElement, oldNode);
    ListItem item = new ListItem(listItemElement);
    item.setParagraphDecorator(decorator);
    item.setTextContent(itemContent);
View Full Code Here

Examples of org.odftoolkit.odfdom.pkg.OdfFileDom.newOdfElement()

        this.textSelection.setSelectionReplaced(true);
    try {
      if (imageContainer == null) {
        delete(index, leftLength, parentElement);
        // PrepareContainer
        imageContainer = ownerDom.newOdfElement(DrawFrameElement.class);
        insertOdfElement(imageContainer, index, parentElement);
      } else {
        NodeList nodeImages = imageContainer.getElementsByTagName("draw:image");
        Node nodeImage = nodeImages.item(0);
        DrawImageElement im = (DrawImageElement) nodeImage;
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.