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

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


      lastRegion = startStructuredDocumentRegion.getRegionAtCharacterOffset(index - 1);
    }
    MultiTextEdit multiTextEdit = new MultiTextEdit();
    try {
      for (int i = 0; i < fRequiredAttrs.size(); i++) {
        CMAttributeDeclaration attrDecl = (CMAttributeDeclaration) fRequiredAttrs.get(i);
        String requiredAttributeName = attrDecl.getAttrName();
        String defaultValue = attrDecl.getDefaultValue();
        if (defaultValue == null) {
          defaultValue = ""; //$NON-NLS-1$
        }
        String nameAndDefaultValue = " "; //$NON-NLS-1$
        if ((i == 0) && (lastRegion.getLength() > lastRegion.getTextLength())) {
View Full Code Here


          }
        }
        attrMap = allAttributes;
       
        Iterator it = attrMap.iterator();
        CMAttributeDeclaration attr = null;
        while (it.hasNext()) {
          attr = (CMAttributeDeclaration) it.next();
          if (attr.getUsage() == CMAttributeDeclaration.REQUIRED) {
            result.add(attr);
          }
        }
      }
    }
View Full Code Here

    String attributeName = attr.getName();

    ModelQuery mq = ModelQueryUtil.getModelQuery(attr.getOwnerDocument());

    if (mq != null) {
      CMAttributeDeclaration ad = mq.getCMAttributeDeclaration(attr);
      if (ad != null) {
        String[] valuesArray = mq.getPossibleDataTypeValues(attr.getOwnerElement(), ad);
        if ((valuesArray != null) && (valuesArray.length > 0)) {
          result = new EnumeratedStringPropertyDescriptor(attributeName, attributeName, valuesArray);
        }
View Full Code Here

            int i = 0;
            while ((i < attributes.getLength())
                && (idTypedAttribute == null)) {
              Node attr = attributes.item(i);
              String attrName = attr.getNodeName();
              CMAttributeDeclaration attrDecl = (CMAttributeDeclaration) elementDecl
                  .getAttributes().getNamedItem(attrName);
              if (attrDecl != null) {
                if ((attrDecl.getAttrType() != null)
                    && (CMDataType.ID.equals(attrDecl
                        .getAttrType()
                        .getDataTypeName()))) {
                  idTypedAttribute = attr;
                } else if ((attrDecl.getUsage() == CMAttributeDeclaration.REQUIRED)
                    && (requiredAttribute == null)) {
                  // as a backup, keep tabs on
                  // any required
                  // attributes
                  requiredAttribute = attr;
View Full Code Here

                        int i = 0;
                        while ((i < attributes.getLength())
                                && (idTypedAttribute == null)) {
                            Node attr = attributes.item(i);
                            String attrName = attr.getNodeName();
                            CMAttributeDeclaration attrDecl = (CMAttributeDeclaration) elementDecl
                                    .getAttributes().getNamedItem(attrName);
                            if (attrDecl != null) {
                                if ((attrDecl.getAttrType() != null)
                                        && (CMDataType.ID.equals(attrDecl
                                                .getAttrType()
                                                .getDataTypeName()))) {
                                    idTypedAttribute = attr;
                                } else if ((attrDecl.getUsage() == CMAttributeDeclaration.REQUIRED)
                                        && (requiredAttribute == null)) {
                                    // as a backup, keep tabs on
                                    // any required
                                    // attributes
                                    requiredAttribute = attr;
View Full Code Here

   */
  public static List<Element> getApplicationInformationElements(Node node, String attributeName) {
    try {
      // Retrieve the declaration
      CMElementDeclaration elementDecl = ToolAnnotationUtils.getCMElementDeclaration(node);
      CMAttributeDeclaration attrDecl = null;

      // No CMElementDeclaration means no attribute metadata, but
      // retrieve the declaration for the attribute otherwise
      if (elementDecl != null) {
        CMNamedNodeMap attributes = elementDecl.getAttributes();
View Full Code Here

            elementDecl, ModelQuery.INCLUDE_ATTRIBUTES);
        Iterator nodeIterator = cmnodes.iterator();
        while (nodeIterator.hasNext()) {
          Object o = nodeIterator.next();
          if (o instanceof CMAttributeDeclaration) {
            CMAttributeDeclaration cmnode = (CMAttributeDeclaration) o;
            decls.add(cmnode);
          }
        }
      }
    }
View Full Code Here

TOP

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

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.