Examples of CMNamedNodeMap


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

      if(manager != null) {
        List trackers = new ArrayList(manager.getTaglibTrackers());
       
        //for each tracker add each of its elements to the node list
        for(int trackerIndex = 0; trackerIndex < trackers.size(); ++trackerIndex) {
          CMNamedNodeMap elements = ((TaglibTracker)trackers.get(trackerIndex)).getElements();
          for(int elementIndex = 0; elementIndex < elements.getLength(); ++elementIndex) {
            nodeList.add(elements.item(elementIndex));
          }
        }
       
        nodes = (CMNode[])nodeList.toArray(new CMNode[nodeList.size()]);
      }
View Full Code Here

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

  private static boolean isTagAvailable(Document document, String elementName) {
    ModelQuery modelQuery = ModelQueryUtil.getModelQuery(document);
    if (modelQuery != null) {
      CMDocument cmdoc = modelQuery.getCorrespondingCMDocument(document);
      CMNamedNodeMap map = cmdoc.getElements();
      if ((CMElementDeclaration) map.getNamedItem(elementName) != null) {
        return true;
      }
    }

    return false;
View Full Code Here

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

  private static boolean isAttributeAvailable(Element element, String attrName) {
    ModelQuery modelQuery = ModelQueryUtil.getModelQuery(element.getOwnerDocument());
    if (modelQuery != null) {
      CMElementDeclaration decl = modelQuery.getCMElementDeclaration(element);
      if (decl != null) {
        CMNamedNodeMap map = decl.getAttributes();
        if ((CMAttributeDeclaration) map.getNamedItem(attrName) != null) {
          return true;
        }
      }
    }
View Full Code Here

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

        enableTagsInDir(StringUtils.strip(prefix), StringUtils.strip(tagdir), anchorStructuredDocumentRegion);
      }
    }

    private void registerTaglib(String prefix, String uri, IStructuredDocumentRegion anchorStructuredDocumentRegion, CMDocument tld) {
      CMNamedNodeMap elements = tld.getElements();
      /*
       * Go through the CMDocument for any tags that must be marked as
       * block tags starting at the anchoring IStructuredDocumentRegion.
       * As the document is edited and the IStructuredDocumentRegion
       * moved around, the block tag enablement will automatically
       * follow it.
       */
      for (int i = 0; i < elements.getLength(); i++) {
        TLDElementDeclaration ed = (TLDElementDeclaration) elements.item(i);
        if (ed.getBodycontent() == JSP12TLDNames.CONTENT_TAGDEPENDENT)
          addBlockTag(prefix + ":" + ed.getNodeName(), anchorStructuredDocumentRegion); //$NON-NLS-1$
      }
      /*
       * Since modifications to StructuredDocumentRegions adjacent to a
View Full Code Here

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

    ModelQuery modelQuery = getModelQuery(node);
    if (modelQuery != null) {
      CMElementDeclaration elementDecl = modelQuery.getCMElementDeclaration((Element) node);
      if (elementDecl != null) {
        CMNamedNodeMap attrMap = elementDecl.getAttributes();
        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

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

      IDOMElement element = (IDOMElement) ir;
      ModelQuery query = ModelQueryUtil.getModelQuery(model);
      if (query != null) {
        CMElementDeclaration cmElement = query.getCMElementDeclaration(element);
        if (cmElement != null) {
          CMNamedNodeMap cmAttributes = null;

          CMNamedNodeMapImpl allAttributes = new CMNamedNodeMapImpl();
          List nodes = query.getAvailableContent(element, cmElement, ModelQuery.INCLUDE_ATTRIBUTES);
          for (int k = 0; k < nodes.size(); k++) {
            CMNode cmnode = (CMNode) nodes.get(k);
View Full Code Here

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

    ModelQuery modelQuery = getModelQuery(node);
    if (modelQuery != null) {
      CMElementDeclaration elementDecl = modelQuery.getCMElementDeclaration((Element) node);
      if (elementDecl != null) {
        CMNamedNodeMap attrMap = elementDecl.getAttributes();
        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

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

          int contentType = elementDeclaration.getContentType();
          if (preferences.isPreservePCDATAContent() && contentType == CMElementDeclaration.PCDATA) {
            formatContraints.setInPreserveSpaceElement(true);
          }
          else {
            CMNamedNodeMap cmAttributes = elementDeclaration.getAttributes();
            // Check implied values from the DTD way.
            CMAttributeDeclaration attributeDeclaration = (CMAttributeDeclaration) cmAttributes.getNamedItem(XML_SPACE);
            if (attributeDeclaration != null) {
              // CMAttributeDeclaration found, check it out.
              String defaultValue = attributeDeclaration.getAttrType().getImpliedValue();

              // xml:space="preserve" means preserve space,
View Full Code Here

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

                childConstraints.setIsWhitespaceStrategyAHint(true);
                childConstraints.setIsIndentStrategyAHint(true);
              }
              else {
                // look for xml:space in content model
                CMNamedNodeMap cmAttributes = elementDeclaration.getAttributes();

                // Not needed - we're looking for xml:space
                //CMNamedNodeMapImpl allAttributes = new CMNamedNodeMapImpl(cmAttributes);
                //List nodes = ModelQueryUtil.getModelQuery(currentNode.getOwnerDocument()).getAvailableContent((Element) currentNode, elementDeclaration, ModelQuery.INCLUDE_ATTRIBUTES);
                //for (int k = 0; k < nodes.size(); k++) {
                //  CMNode cmnode = (CMNode) nodes.get(k);
                //  if (cmnode.getNodeType() == CMNode.ATTRIBUTE_DECLARATION) {
                //    allAttributes.put(cmnode);
                //  }
                //}
                //cmAttributes = allAttributes;

                // Check implied values from the DTD way.
                CMAttributeDeclaration attributeDeclaration = (CMAttributeDeclaration) cmAttributes.getNamedItem(XML_SPACE);
                if (attributeDeclaration != null) {
                  // CMAttributeDeclaration found, check
                  // it
                  // out.
View Full Code Here

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

    ModelQuery modelQuery = getModelQuery(node);
    if (modelQuery != null) {
      CMElementDeclaration elementDecl = modelQuery.getCMElementDeclaration((Element) node);
      if (elementDecl != null) {
        CMNamedNodeMap attrMap = elementDecl.getAttributes();
        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
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.