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

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


        URIResolver resolver = URIResolverPlugin.createResolver();
        grammarURI = resolver.resolve(null, id, id);
      }


      CMDocument document = ContentModelManager.getInstance().createCMDocument(URIHelper.getURIForFilePath(grammarURI), "xsd"); //$NON-NLS-1$
      if(document != null) {
        List namespaceInfoList = (List) document.getProperty("http://org.eclipse.wst/cm/properties/namespaceInfo"); //$NON-NLS-1$
        if(namespaceInfoList != null) {
          NamespaceInfo info = (NamespaceInfo) namespaceInfoList.get(0);
          if(info != null) {
            if ((uriField.getText().trim().length() == 0) && (info.uri != null)) {
              uriField.setText(info.uri);
View Full Code Here


    if (isXMLType()) {
      if (name.equals(IXMLCharEntity.APOS_NAME))
        return IXMLCharEntity.APOS_VALUE;
    }

    CMDocument cm = getCMDocument();
    if (cm != null) {
      CMNamedNodeMap map = cm.getEntities();
      if (map != null) {
        CMEntityDeclaration decl = (CMEntityDeclaration) map.getNamedItem(name);
        if (decl != null) {
          String value = decl.getValue();
          if (value == null)
View Full Code Here

        // get entity proposals, passing in the appropriate start
        // string
        ModelQuery mq = ModelQueryUtil.getModelQuery(((Node) treeNode).getOwnerDocument());
        if (mq != null) {
          CMDocument xmlDoc = mq.getCorrespondingCMDocument(treeNode);
          CMNamedNodeMap cmmap = null;
          Properties entities = null;
          if (xmlDoc != null) {
            cmmap = xmlDoc.getEntities();
          }
          if (cmmap != null) {
            entities = mapToProperties(cmmap);
          }
          else // 224787 in absence of content model, just use
View Full Code Here

    }

    list = new ArrayList(1);
    ModelQuery modelQuery = ModelQueryUtil.getModelQuery(document);
    if (modelQuery != null) {
      CMDocument cmdoc = modelQuery.getCorrespondingCMDocument(document);
      if (cmdoc != null) {
        if (rootName != null) {
          CMElementDeclaration rootDecl = (CMElementDeclaration) cmdoc.getElements().getNamedItem(rootName);
          if (rootDecl != null) {
            list.add(rootDecl);
          }
          else {
            // supply the given document name anyway, even if it
View Full Code Here

    for (Iterator iter = trackers.iterator(); iter.hasNext();) {
      TaglibTracker tracker = (TaglibTracker) iter.next();
      if (uri.equals(tracker.getURI())) {
        return tracker.getPrefix();
      }
            CMDocument cmdoc = tracker.getDocument();
            if (cmdoc instanceof TLDDocument
                && uri.equals(((TLDDocument) cmdoc).getUri())) {
              return tracker.getPrefix();
            }
    }
View Full Code Here

    }
    List trackers = m.getTaglibTrackers();
    for (Iterator iter = trackers.iterator(); iter.hasNext();) {
      TaglibTracker tracker = (TaglibTracker) iter.next();
      if (prefix.equals(tracker.getPrefix())) {
        CMDocument cmdoc = tracker.getDocument();
        if (cmdoc instanceof TLDDocument) {
          return ((TLDDocument) cmdoc).getUri();
        }
                break; // fall out and return null
      }
View Full Code Here

    }
    return reg;
  }

  private void registerHTMLCategory() {
    final CMDocument doc = HTMLCMDocumentFactory.getCMDocument(CMDocType.HTML_DOC_TYPE);
    _paletteHelper.getOrCreateTaglibPaletteDrawer(this, doc, CMDocType.HTML_DOC_TYPE);
  }
View Full Code Here

    final CMDocument doc = HTMLCMDocumentFactory.getCMDocument(CMDocType.HTML_DOC_TYPE);
    _paletteHelper.getOrCreateTaglibPaletteDrawer(this, doc, CMDocType.HTML_DOC_TYPE);
  }

  private void registerJSPCategory() {
    final CMDocument doc = HTMLCMDocumentFactory.getCMDocument(CMDocType.JSP11_DOC_TYPE);
    _paletteHelper.getOrCreateTaglibPaletteDrawer(this, doc, CMDocType.JSP11_DOC_TYPE);
  }
View Full Code Here

    final CMDocument doc = HTMLCMDocumentFactory.getCMDocument(CMDocType.JSP11_DOC_TYPE);
    _paletteHelper.getOrCreateTaglibPaletteDrawer(this, doc, CMDocType.JSP11_DOC_TYPE);
  }
 
  private void registerTapestryCategory(){
    final CMDocument doc = HTMLCMDocumentFactory.getCMDocument(CMDocType.TAPESTRY5_DOC_TYPE);
    _paletteHelper.getOrCreateTaglibPaletteDrawer(this, doc, CMDocType.TAPESTRY5_DOC_TYPE);
  }
View Full Code Here

   *
   * @see org.eclipse.wst.xml.core.internal.contentmodel.modelqueryimpl.
   * ModelQueryImpl#getCorrespondingCMDocument(org.w3c.dom.Node)
   */
  public CMDocument getCorrespondingCMDocument(Node node) {
    CMDocument document = super.getCorrespondingCMDocument(node);
    if (document == null) {
      ModelQuery embeddedModelQuery = getEmbeddedModelQuery(node);
      if (embeddedModelQuery != null) {
        return embeddedModelQuery.getCorrespondingCMDocument(node);
      }
View Full Code Here

TOP

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

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.