Examples of CMDocument


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

        return null;
      return (CMElementDeclaration) cmnode;
    }

    private void addSSIDecls() {
      CMDocument ssi = SSICMDocumentFactory.getCMDocument();
      if (ssi == null)
        return;
      CMNamedNodeMap elements = ssi.getElements();
      Iterator i = elements.iterator();
      while (i.hasNext()) {
        CMElementDeclaration decl = (CMElementDeclaration) i.next();
        if (decl == null)
          continue;
View Full Code Here

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

    provider.setValidating(false);
    provider.setBaseReference(jarFileName);
    provider.setRootElementName(JSP11TLDNames.TAGLIB);
    provider.setJarFileName(jarFileName);
    provider.setFileName(contentFileName);
    CMDocument document = loadDocument("jar:file://" + jarFileName + "!" + contentFileName, provider.getRootElement()); //$NON-NLS-1$ //$NON-NLS-2$
    // TODO: Add the tags declared in META-INF/tags, see JSP 2.0 section
    // 8.4.1
    return document;
  }
View Full Code Here

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

   *
   * @param uri -
   *            the location of a valid taglib descriptor
   */
  public CMDocument createCMDocument(String uri) {
    CMDocument result = null;
    URL url = null;
    try {
      url = new URL(uri);
    }
    catch (MalformedURLException e) {
View Full Code Here

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

  /**
   * @param fileName
   * @return
   */
  private CMDocument createCMDocumentFromFile(String fileName) {
    CMDocument result = null;
    if (fileName.endsWith(".jar")) { //$NON-NLS-1$
      result = buildCMDocumentFromJar(fileName);
    }
    else {
      File file = new File(fileName);
View Full Code Here

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

      if (mgr != null) {

        List trackers = mgr.getCMDocumentTrackers(-1);
        Iterator taglibs = trackers.iterator();
 
        CMDocument doc = null;
        CMNamedNodeMap elements = null;
        while (taglibs.hasNext()) {
          doc = (CMDocument) taglibs.next();
          CMNode node = null;
          if ((elements = doc.getElements()) != null && (node = elements.getNamedItem(tagToAdd)) != null && node.getNodeType() == CMNode.ELEMENT_DECLARATION) {
 
            if (node instanceof CMNodeWrapper) {
              node = ((CMNodeWrapper) node).getOriginNode();
            }
            TLDElementDeclaration tldElementDecl = (TLDElementDeclaration) node;
View Full Code Here

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

      // if (support == null)
      // return new TaglibVariable[0];
      //
      // Iterator taglibs =
      // support.getCMDocuments(customTag.getStartOffset()).iterator();
      CMDocument doc = null;
      CMNamedNodeMap elements = null;
      while (taglibs.hasNext()) {
        doc = (CMDocument) taglibs.next();
        CMNode node = null;
        if ((elements = doc.getElements()) != null && (node = elements.getNamedItem(tagToAdd)) != null && node.getNodeType() == CMNode.ELEMENT_DECLARATION) {

          if (node instanceof CMNodeWrapper) {
            node = ((CMNodeWrapper) node).getOriginNode();
          }
          TLDElementDeclaration tldElementDecl = (TLDElementDeclaration) node;
View Full Code Here

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

    if(!this.isXHTML) {
      IDOMNode node = (IDOMNode) contentAssistRequest.getNode();
 
      ModelQuery mq = ModelQueryUtil.getModelQuery(node.getOwnerDocument());
      if (mq != null) {
        CMDocument doc = mq.getCorrespondingCMDocument(node);
        // this shouldn't have to have the prefix coded in
        if (doc instanceof JSPCMDocument || doc instanceof CMNodeWrapper ||
            node.getNodeName().startsWith("jsp:")) { //$NON-NLS-1$
          return;
        }
View Full Code Here

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

      if (documentManager != null) {
        List docs = documentManager.getCMDocumentTrackers(prefix, this.fTranslator.getCurrentNode().getStartOffset());
        Iterator it = docs.iterator();
        Iterator elements = null;
        CMNode node = null;
        CMDocument doc = null;
        BlockMarker marker = null;
        while (it.hasNext()) {
          doc = (CMDocument) it.next();
          elements = doc.getElements().iterator();
          while (elements.hasNext()) {
            node = (CMNode) elements.next();
            marker = new BlockMarker(node.getNodeName(), null, DOMJSPRegionContexts.JSP_CONTENT, true);
            // global scope is OK because we have encountered this
            // <@taglib> directive
View Full Code Here

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

      TLDCMDocumentManager mgr = TaglibController.getTLDCMDocumentManager(((IDOMNode) node).getStructuredDocument());
      if (mgr != null) {
        List moreCMDocuments = mgr.getCMDocumentTrackers(textInsertionOffset);
        if (moreCMDocuments != null) {
          for (int i = 0; i < moreCMDocuments.size(); i++) {
            CMDocument doc = (CMDocument) moreCMDocuments.get(i);
            CMNamedNodeMap elements = doc.getElements();
            if (elements != null) {
              for (int j = 0; j < elements.getLength(); j++) {
                CMElementDeclaration ed = (CMElementDeclaration) elements.item(j);
                elementDecls.add(ed);
              }
            }
          }
        }
      }

      // get position dependent CMDocuments and insert their tags as
      // proposals

      ModelQueryAdapter mqAdapter = null;
      if (node.getNodeType() == Node.DOCUMENT_NODE)
        mqAdapter = (ModelQueryAdapter) ((IDOMNode) node).getAdapterFor(ModelQueryAdapter.class);
      else
        mqAdapter = (ModelQueryAdapter) ((IDOMNode) node.getOwnerDocument()).getAdapterFor(ModelQueryAdapter.class);

      if (mqAdapter != null) {
        CMDocument doc = mqAdapter.getModelQuery().getCorrespondingCMDocument(node);
        if (doc != null) {
          CMDocument jcmdoc = getDefaultJSPCMDocument((IDOMNode) node);
          CMNamedNodeMap jspelements = jcmdoc.getElements();

          /*
           * For a built-in JSP action the content model is properly
           * set up, so don't just blindly add the rest--unless this
           * will be a direct child of the document
View Full Code Here

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

    // handle tag files here
    String contentType = node.getModel().getContentTypeIdentifier();
    if (ContentTypeIdForJSP.ContentTypeID_JSPTAG.equals(contentType))
      return JSPCMDocumentFactory.getCMDocument(CMDocType.TAG20_DOC_TYPE);

    CMDocument jcmdoc = null;
    String modelPath = node.getModel().getBaseLocation();
    if (modelPath != null && !IModelManager.UNMANAGED_MODEL.equals(modelPath)) {
      float version = DeploymentDescriptorPropertyCache.getInstance().getJSPVersion(new Path(modelPath));
      jcmdoc = JSPCMDocumentFactory.getCMDocument(version);
    }
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.