Package org.eclipse.wst.xml.core.internal.contentmodel

Examples of org.eclipse.wst.xml.core.internal.contentmodel.CMDataType


  {
    CMNode[] cmNodeArray = null;
    validate(ed, elementContent, comparator, result);
    if (result.isValid)
    {
      CMDataType dataType = ed.getDataType();
      int size = elementContent.size();
      cmNodeArray = new CMNode[size];
      Vector originList = result.getElementOriginList();
      int originListSize = originList.size();
      int originListIndex = 0;
View Full Code Here


  {
    List list = new ArrayList();                           
                              
    if (cmNode != null)
    {      
      CMDataType dataType = null;
      if (cmNode.getNodeType() == CMNode.ATTRIBUTE_DECLARATION)
      {
        dataType = ((CMAttributeDeclaration)cmNode).getAttrType();
      }
      else if (cmNode.getNodeType() == CMNode.ELEMENT_DECLARATION)
      {
        dataType = ((CMElementDeclaration)cmNode).getDataType();
      }        
    
      String[] enumeratedValues = dataType != null ? dataType.getEnumeratedValues() : null;     
      if (enumeratedValues != null)
      {
        for (int i = 0; i < enumeratedValues.length; i++)
        {
          list.add(enumeratedValues[i]);
View Full Code Here

          visitCMNode(content);
        }

        if (ed.getContentType() == CMElementDeclaration.PCDATA)
        {
          CMDataType dataType = ed.getDataType();
          if (dataType != null)
          {
            visitCMDataType(dataType);
          }
        }
View Full Code Here

  }


  public CMDataType getCMDataType(Text text)
  {
    CMDataType result = null;
    Node parentNode = text.getParentNode();
    if (parentNode != null && parentNode.getNodeType() == Node.ELEMENT_NODE)
    {
      CMElementDeclaration ed = getCMElementDeclaration((Element)parentNode);
      result = ed.getDataType();
View Full Code Here

    return descriptor;
  }

  protected IPropertyDescriptor createPropertyDescriptor(CMAttributeDeclaration attrDecl, Attr attr) {
    IPropertyDescriptor descriptor = null;
    CMDataType attrType = attrDecl.getAttrType();

    if (attrType != null) {
      // handle declarations that provide FIXED/ENUMERATED values
      if ((attrType.getEnumeratedValues() != null) && (attrType.getEnumeratedValues().length > 0)) {
        descriptor = createEnumeratedPropertyDescriptor(attrDecl, attrType, attr);
      }
      else if (((attrDecl.getUsage() == CMAttributeDeclaration.FIXED) || (attrType.getImpliedValueKind() == CMDataType.IMPLIED_VALUE_FIXED)) && (attrType.getImpliedValue() != null)) {
        descriptor = createFixedPropertyDescriptor(attrDecl, attrType, attr);
      }
      else {
        // plain text
        descriptor = createTextPropertyDescriptor(attrDecl, attr);
View Full Code Here

    if (attrDecl == null) {
      return new String[0];
    }

    String[] validValues = null;
    CMDataType attrType = attrDecl.getAttrType();
    if (attrType != null) {
      validValues = _getValidStrings(attrDecl, attrType);
      if (fSortEnumeratedValues) {
        Arrays.sort(validValues);
      }
View Full Code Here

    if (attrDecls != null) {
      CMAttributeDeclaration attrDecl = (CMAttributeDeclaration) attrDecls.getNamedItem(property);
      String defValue = null;
      if (attrDecl != null) {
        if (attrDecl.getAttrType() != null) {
          CMDataType helper = attrDecl.getAttrType();
          if ((helper.getImpliedValueKind() != CMDataType.IMPLIED_VALUE_NONE) && (helper.getImpliedValue() != null)) {
            defValue = helper.getImpliedValue();
          }
        }
      }
      if ((defValue != null) && (defValue.length() > 0)) {
        // implied values will be in the DOM, but not the source
View Full Code Here

        sb.append(PARAGRAPH_START + BOLD_START + XMLUIMessages.Element____1 + SPACE + BOLD_END);
        sb.append(node.getNodeName());
        sb.append(PARAGRAPH_END);
        printDocumentation(sb, node);
        if (ed.getContentType() == CMElementDeclaration.PCDATA) {
          CMDataType dataType = ed.getDataType();
          if (dataType != null) {
            printDataTypeInfo(sb, dataType);
          }
        }
        else {
          CMDescriptionBuilder builder = new CMDescriptionBuilder();
          String description = builder.buildDescription(node);
          if ((description != null) && (description.length() > 0)) {
            sb.append(PARAGRAPH_START + BOLD_START + XMLUIMessages.Content_Model____2 + SPACE + BOLD_END);
            sb.append(description + PARAGRAPH_END);
          }
        }
      }
      else if (node.getNodeType() == CMNode.ATTRIBUTE_DECLARATION) {
        CMAttributeDeclaration ad = (CMAttributeDeclaration) node;
        sb.append(PARAGRAPH_START + BOLD_START + XMLUIMessages.Attribute____3 + SPACE + BOLD_END);
        sb.append(node.getNodeName());
        sb.append(PARAGRAPH_END);
        printDocumentation(sb, node);
        CMDataType dataType = ad.getAttrType();
        if (dataType != null) {
          printDataTypeInfo(sb, dataType);
        }
      }
      else if (node.getNodeType() == CMNode.DATA_TYPE) {
View Full Code Here

          if (parent != null && parent.getNodeType() == Node.ELEMENT_NODE) {
            final ModelQuery mq = ModelQueryUtil.getModelQuery(parent.getOwnerDocument());
            if (mq != null) {
              final CMElementDeclaration decl = mq.getCMElementDeclaration((Element) parent);
              if (decl != null) {
                final CMDataType type= decl.getDataType();
                shouldSpellcheck = type == null || type.getEnumeratedValues() == null || type.getEnumeratedValues().length == 0;
              }
            }
          }
        }
      }
View Full Code Here

        if (content != null) {
          visitCMNode(content);
        }

        if (ed.getContentType() == CMElementDeclaration.PCDATA) {
          CMDataType dataType = ed.getDataType();
          if (dataType != null) {
            visitCMDataType(dataType);
          }
        }
        // end duplication
View Full Code Here

TOP

Related Classes of org.eclipse.wst.xml.core.internal.contentmodel.CMDataType

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.