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

Examples of org.odftoolkit.odfdom.dom.element.table.TableTableElement


      }
      if (columnLabel != null) {
        columnHeaders = 1;
      }
      try {
        TableTableElement newTEle = createTable(ownerContainer, rowNumber + rowHeaders, columnNumber
            + columnHeaders, rowHeaders, columnHeaders);
        // append to the end of table container
        ownerContainer.getTableContainerElement().appendChild(newTEle);

        Table table = getTableInstance(newTEle);
View Full Code Here


          textSelection.cleanBreakProperty(orgparagraph);
      }
    } else{
      TextDocument document = (TextDocument) tableContainer
          .getOwnerDocument();
      TableTableElement newTEle = (TableTableElement) document
          .insertOdfElement(tableContainer.getOdfElement(),
              tableContainer.getOwnerDocument(),
              sourceTable.getOdfElement(), true);
      tableContainer.getOdfElement().getParentNode()
          .removeChild(tableContainer.getOdfElement());
View Full Code Here

   *            the row element that need to get the corresponding
   *            <code>Row</code> instance
   * @return the <code>Row</code> instance represent the specified row element
   */
  public static Row getInstance(TableTableRowElement rowElement) {
    TableTableElement tableElement = null;
    Node node = rowElement.getParentNode();
    while (node != null) {
      if (node instanceof TableTableElement) {
        tableElement = (TableTableElement) node;
      }
View Full Code Here

   * Get owner table of the current row.
   *
   * @return the parent table of this row
   */
  public Table getTable() {
    TableTableElement tableElement = getTableElement();
    if (tableElement != null) {
      return Table.getInstance(tableElement);
    }
    return null;
  }
View Full Code Here

   *
   * @return the index of the row
   */
  public int getRowIndex() {
    int result = 0;
    TableTableElement mTableElement = getTableElement();
    TableTableRowElement rowEle = null;
    for (Node n : new DomNodeList(mTableElement.getChildNodes())) {
      if (n instanceof TableTableHeaderRowsElement) {
        TableTableHeaderRowsElement headers = (TableTableHeaderRowsElement) n;
        for (Node m : new DomNodeList(headers.getChildNodes())) {
          if (m instanceof TableTableRowElement) {
            rowEle = (TableTableRowElement) m;
View Full Code Here

   * Create child element {@odf.element table:table}.
   *
   * @return the element {@odf.element table:table}
   */
  public TableTableElement newTableTableElement() {
    TableTableElement tableTable = ((OdfFileDom) this.ownerDocument).newOdfElement(TableTableElement.class);
    this.appendChild(tableTable);
    return tableTable;
  }
View Full Code Here

   * Create child element {@odf.element table:table}.
   *
   * @return the element {@odf.element table:table}
   */
  public TableTableElement newTableTableElement() {
    TableTableElement tableTable = ((OdfFileDom) this.ownerDocument).newOdfElement(TableTableElement.class);
    this.appendChild(tableTable);
    return tableTable;
  }
View Full Code Here

   *
   * @param rowElement  the row element that need to get the corresponding <code>OdfTableRow</code> instance
   * @return the <code>OdfTableRow</code> instance represent the specified row element
   */
  public static OdfTableRow getInstance(TableTableRowElement rowElement) {
    TableTableElement tableElement = null;
    Node node = rowElement.getParentNode();
    while (node != null) {
      if (node instanceof TableTableElement) {
        tableElement = (TableTableElement) node;
      }
View Full Code Here

  /**
   * Get owner table of the current row.
   * @return  the parent table of this row
   */
  public OdfTable getTable() {
    TableTableElement tableElement = getTableElement();
    if (tableElement != null) {
      return OdfTable.getInstance(tableElement);
    }
    return null;
  }
View Full Code Here

  //the maRowElement/mnRepeatedIndex should also be updated according to the original index in the repeated column
  void splitRepeatedRows() {
    int repeateNum = getRowsRepeatedNumber();
    if (repeateNum > 1) {
      OdfTable table = getTable();
      TableTableElement tableEle = table.getOdfElement();
      //change this repeated row to several single rows
      TableTableRowElement ownerRowElement = null;
      int repeatedRowIndex = mnRepeatedIndex;
      Node refElement = maRowElement;
      Node oldRowElement = maRowElement;
      for (int i = repeateNum - 1; i >= 0; i--) {
        TableTableRowElement newRow = (TableTableRowElement) maRowElement.cloneNode(true);
        newRow.removeAttributeNS(OdfDocumentNamespace.TABLE.getUri(), "number-rows-repeated");
        tableEle.insertBefore(newRow, refElement);
        refElement = newRow;
        if (repeatedRowIndex == i) {
          ownerRowElement = newRow;
        } else {
          table.updateRowRepository(maRowElement, i, newRow, 0);
        }
      }

      if (ownerRowElement != null) {
        table.updateRowRepository(maRowElement, mnRepeatedIndex, ownerRowElement, 0);
      }
      tableEle.removeChild(oldRowElement);
      mRowsRepeatedNumber = -1;
    }
  }
View Full Code Here

TOP

Related Classes of org.odftoolkit.odfdom.dom.element.table.TableTableElement

Copyright © 2018 www.massapicom. 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.