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

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


   * Create child element {@odf.element table:content-validations}.
   *
   * @return the element {@odf.element table:content-validations}
   */
  public TableContentValidationsElement newTableContentValidationsElement() {
    TableContentValidationsElement tableContentValidations = ((OdfFileDom) this.ownerDocument).newOdfElement(TableContentValidationsElement.class);
    this.appendChild(tableContentValidations);
    return tableContentValidations;
  }
View Full Code Here


  ///////////////////////////////////////////////////////////////////////////////////////////////////////////////////
 
  private TableContentValidationElement getContentValidationEle() throws Exception {
    Document ownerDocument = getOwnerDocument();
    OdfElement contentRootElement = ownerDocument.getContentRoot();
    TableContentValidationsElement validations = OdfElement.findFirstChildNode(
        TableContentValidationsElement.class, contentRootElement);
    if (validations == null) {
      validations = (TableContentValidationsElement) OdfXMLFactory.newOdfElement(ownerDocument
          .getContentDom(), OdfName.newName(OdfDocumentNamespace.TABLE, "content-validations"));
      contentRootElement.insertBefore(validations, contentRootElement.getFirstChild());
    }
    String validationName = getOdfElement().getTableContentValidationNameAttribute();
    TableContentValidationElement validationElement = null;
    if (validationName != null) {
      Node child = validations.getFirstChild();
      while (child != null) {
        TableContentValidationElement contentValidationElementRef = (TableContentValidationElement) child;
        if (validationName.equals(contentValidationElementRef.getTableNameAttribute())) {
          validationElement = contentValidationElementRef;
          break;
        }
      }
    } else {
      String valName = "val" + String.format("d%06x", (int) (Math.random() * 0xffffff));
      validationElement = validations.newTableContentValidationElement(valName);
      getOdfElement().setTableContentValidationNameAttribute(valName);
    }
    return validationElement;
  }
View Full Code Here

  ///////////////////////////////////////////////////////////////////////////////////////////////////////////////////
 
  private TableContentValidationElement getContentValidationEle() throws Exception {
    Document ownerDocument = getOwnerDocument();
    OdfElement contentRootElement = ownerDocument.getContentRoot();
    TableContentValidationsElement validations = OdfElement.findFirstChildNode(
        TableContentValidationsElement.class, contentRootElement);
    if (validations == null) {
      validations = (TableContentValidationsElement) OdfXMLFactory.newOdfElement(ownerDocument
          .getContentDom(), OdfName.newName(OdfDocumentNamespace.TABLE, "content-validations"));
      contentRootElement.insertBefore(validations, contentRootElement.getFirstChild());
    }
    String validationName = getOdfElement().getTableContentValidationNameAttribute();
    TableContentValidationElement validationElement = null;
    if (validationName != null) {
      Node child = validations.getFirstChild();
      while (child != null) {
        TableContentValidationElement contentValidationElementRef = (TableContentValidationElement) child;
        if (validationName.equals(contentValidationElementRef.getTableNameAttribute())) {
          validationElement = contentValidationElementRef;
          break;
        }
      }
    } else {
      String valName = "val" + String.format("d%06x", (int) (Math.random() * 0xffffff));
      validationElement = validations.newTableContentValidationElement(valName);
      getOdfElement().setTableContentValidationNameAttribute(valName);
    }
    return validationElement;
  }
View Full Code Here

  ///////////////////////////////////////////////////////////////////////////////////////////////////////////////////
 
  private TableContentValidationElement getContentValidationEle() throws Exception {
    Document ownerDocument = getOwnerDocument();
    OdfElement contentRootElement = ownerDocument.getContentRoot();
    TableContentValidationsElement validations = OdfElement.findFirstChildNode(
        TableContentValidationsElement.class, contentRootElement);
    if (validations == null) {
      validations = (TableContentValidationsElement) OdfXMLFactory.newOdfElement(ownerDocument
          .getContentDom(), OdfName.newName(OdfDocumentNamespace.TABLE, "content-validations"));
      contentRootElement.insertBefore(validations, contentRootElement.getFirstChild());
    }
    String validationName = getOdfElement().getTableContentValidationNameAttribute();
    TableContentValidationElement validationElement = null;
    if (validationName != null) {
      Node child = validations.getFirstChild();
      while (child != null) {
        TableContentValidationElement contentValidationElementRef = (TableContentValidationElement) child;
        if (validationName.equals(contentValidationElementRef.getTableNameAttribute())) {
          validationElement = contentValidationElementRef;
          break;
        }
      }
    } else {
      String valName = "val" + String.format("d%06x", (int) (Math.random() * 0xffffff));
      validationElement = validations.newTableContentValidationElement(valName);
      getOdfElement().setTableContentValidationNameAttribute(valName);
    }
    return validationElement;
  }
View Full Code Here

   * Create child element {@odf.element table:content-validations}.
   *
   * @return the element {@odf.element table:content-validations}
   */
  public TableContentValidationsElement newTableContentValidationsElement() {
    TableContentValidationsElement tableContentValidations = ((OdfFileDom) this.ownerDocument).newOdfElement(TableContentValidationsElement.class);
    this.appendChild(tableContentValidations);
    return tableContentValidations;
  }
View Full Code Here

   * Create child element {@odf.element table:content-validations}.
   *
   * @return the element {@odf.element table:content-validations}
   */
  public TableContentValidationsElement newTableContentValidationsElement() {
    TableContentValidationsElement tableContentValidations = ((OdfFileDom) this.ownerDocument).newOdfElement(TableContentValidationsElement.class);
    this.appendChild(tableContentValidations);
    return tableContentValidations;
  }
View Full Code Here

   * Create child element {@odf.element table:content-validations}.
   *
   * @return the element {@odf.element table:content-validations}
   */
  public TableContentValidationsElement newTableContentValidationsElement() {
    TableContentValidationsElement tableContentValidations = ((OdfFileDom) this.ownerDocument).newOdfElement(TableContentValidationsElement.class);
    this.appendChild(tableContentValidations);
    return tableContentValidations;
  }
View Full Code Here

   * Create child element {@odf.element table:content-validations}.
   *
   * @return the element {@odf.element table:content-validations}
   */
  public TableContentValidationsElement newTableContentValidationsElement() {
    TableContentValidationsElement tableContentValidations = ((OdfFileDom) this.ownerDocument).newOdfElement(TableContentValidationsElement.class);
    this.appendChild(tableContentValidations);
    return tableContentValidations;
  }
View Full Code Here

   * Create child element {@odf.element table:content-validations}.
   *
   * @return the element {@odf.element table:content-validations}
   */
  public TableContentValidationsElement newTableContentValidationsElement() {
    TableContentValidationsElement tableContentValidations = ((OdfFileDom) this.ownerDocument).newOdfElement(TableContentValidationsElement.class);
    this.appendChild(tableContentValidations);
    return tableContentValidations;
  }
View Full Code Here

TOP

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

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.