Package org.odftoolkit.odfdom.dom.element.text

Examples of org.odftoolkit.odfdom.dom.element.text.TextUserFieldDeclElement


      }
    }
    TextUserFieldDeclsElement userVariableElements = OdfElement.findFirstChildNode(TextUserFieldDeclsElement.class,
        containerElement);
    if (userVariableElements != null) {
      TextUserFieldDeclElement userVariableElement = (TextUserFieldDeclElement) userVariableElements
          .getFirstChild();
      while (userVariableElement != null) {
        if (name.equals(userVariableElement.getTextNameAttribute())) {
          return Fields.createUserVariableField(this, name, "");
        } else {
          userVariableElement = (TextUserFieldDeclElement) userVariableElement.getNextSibling();
        }
      }
    }
    return null;
  }
View Full Code Here


      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())) {
            userVariableElement = userVariableElementTmp;
            break;
          } else {
            userVariableElementTmp = (TextUserFieldDeclElement) userVariableElementTmp.getNextSibling();
          }
        }
      }
      if (userVariableElement == null) {
        userVariableElement = userVariableElements.newTextUserFieldDeclElement(0, "string", name);
View Full Code Here

      }
    }
    TextUserFieldDeclsElement userVariableElements = OdfElement.findFirstChildNode(TextUserFieldDeclsElement.class,
        containerElement);
    if (userVariableElements != null) {
      TextUserFieldDeclElement userVariableElement = (TextUserFieldDeclElement) userVariableElements
          .getFirstChild();
      while (userVariableElement != null) {
        if (name.equals(userVariableElement.getTextNameAttribute())) {
          String type = userVariableElement.getOfficeValueTypeAttribute();
          if(type.equalsIgnoreCase("string")){
            String stringValue = userVariableElement.getOfficeStringValueAttribute();
            return Fields.createUserVariableField(this, name, stringValue);
          }
          Double DoubleValue = userVariableElement.getOfficeValueAttribute();
          DoubleValue.toString();
          return Fields.createUserVariableField(this, name, DoubleValue.toString());
        } else {
          userVariableElement = (TextUserFieldDeclElement) userVariableElement.getNextSibling();
        }
      }
    }
    return null;
  }
View Full Code Here

      nextFieldSelection.replaceWithVariableField(simplefield);
      newfield=simplefield;
      break;
    case USER_VARIABLE_FIELD:
      VariableField userVariableField = (VariableField)orgField;
      TextUserFieldDeclElement textUserFieldDeclElement =(TextUserFieldDeclElement) userVariableField.getOdfElement();
      String fieldname = userVariableField.getVariableName();
      String value=textUserFieldDeclElement.getOfficeStringValueAttribute();
      VariableField variableField=Fields.createUserVariableField(document, fieldname,value);
      nextFieldSelection.replaceWithVariableField(variableField);
      newfield=variableField;
      break;
    case CONDITION_FIELD:
View Full Code Here

TOP

Related Classes of org.odftoolkit.odfdom.dom.element.text.TextUserFieldDeclElement

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.