Package org.odftoolkit.odfdom.pkg

Examples of org.odftoolkit.odfdom.pkg.OdfElement.insertBefore()


    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();
View Full Code Here


    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();
View Full Code Here

    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();
View Full Code Here

    case SIMPLE:
      simpleVariableElements = OdfElement.findFirstChildNode(TextVariableDeclsElement.class, containerElement);
      if (simpleVariableElements == null) {
        simpleVariableElements = ((OdfFileDom) containerElement.getOwnerDocument())
            .newOdfElement(TextVariableDeclsElement.class);
        containerElement.insertBefore(simpleVariableElements, containerElement.getFirstChild());
      } else {
        TextVariableDeclElement simpleVariableElementTmp = (TextVariableDeclElement) simpleVariableElements
            .getFirstChild();
        while (simpleVariableElementTmp != null) {
          if (name.equals(simpleVariableElementTmp.getTextNameAttribute())) {
View Full Code Here

    case USER:
      userVariableElements = OdfElement.findFirstChildNode(TextUserFieldDeclsElement.class, containerElement);
      if (userVariableElements == null) {
        userVariableElements = ((OdfFileDom) containerElement.getOwnerDocument())
            .newOdfElement(TextUserFieldDeclsElement.class);
        containerElement.insertBefore(userVariableElements, containerElement.getFirstChild());
      } else {
        TextUserFieldDeclElement userVariableElementTmp = (TextUserFieldDeclElement) userVariableElements
            .getFirstChild();
        while (userVariableElementTmp != null) {
          if (name.equals(userVariableElementTmp.getTextNameAttribute())) {
View Full Code Here

      } else if (refElement instanceof TextSpanElement) {
        textVariableSetElement = ((TextSpanElement) refElement).newTextVariableSetElement(0, "string", name);
      } else {
        TextPElement pElement = ((OdfFileDom) refElement.getOwnerDocument()).newOdfElement(TextPElement.class);
        OdfElement parentEle = (OdfElement) refElement.getParentNode();
        parentEle.insertBefore(pElement, refElement.getNextSibling());
        textVariableSetElement = pElement.newTextVariableSetElement(0, "string", name);
      }
      textVariableSetElement.removeAttributeNS(officeNS, "value");
      textVariableSetElement.setOfficeStringValueAttribute(value);
      textVariableSetElement.setTextContent(value);
View Full Code Here

      if (refElement instanceof TextPElement) {
        textPElement = (TextPElement) refElement;
      } else {
        textPElement = ((OdfFileDom) refElement.getOwnerDocument()).newOdfElement(TextPElement.class);
        OdfElement parentEle = (OdfElement) refElement.getParentNode();
        parentEle.insertBefore(textPElement, refElement.getNextSibling());
      }
      switch (type) {
      case SIMPLE:
        textPElement.newTextVariableGetElement(name);
        break;
View Full Code Here

      name = referenceName;
      // insert start target element
      referenceMarkStartElement = ((OdfFileDom) odfElement.getOwnerDocument())
          .newOdfElement(TextReferenceMarkStartElement.class);
      referenceMarkStartElement.setTextNameAttribute(referenceName);
      parentEle.insertBefore(referenceMarkStartElement, odfElement);
      // insert end target element
      referenceMarkEndElement = ((OdfFileDom) odfElement.getOwnerDocument())
          .newOdfElement(TextReferenceMarkEndElement.class);
      referenceMarkEndElement.setTextNameAttribute(referenceName);
      OdfElement nextSiblingEle = (OdfElement) odfElement.getNextSibling();
View Full Code Here

      TextPElement pElement = ((OdfFileDom) odfEle.getOwnerDocument()).newOdfElement(TextPElement.class);
      pElement.appendChild(spanElement);
      if (nextSiblingEle == null) {
        parentEle.appendChild(pElement);
      } else {
        parentEle.insertBefore(pElement, nextSiblingEle);
      }
    }
  }

  public OdfElement getOdfElement() {
View Full Code Here

      aElement.setXlinkTypeAttribute("simple");
      parent.removeChild(thisFrame);
      aElement.appendChild(thisFrame);
      if (brother == null)
        parent.appendChild(aElement);
      parent.insertBefore(aElement, brother);
    } catch (Exception e) {
      Logger.getLogger(Frame.class.getName()).log(Level.SEVERE, e.getMessage(), e);
    }
  }
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.