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

Examples of org.eclipse.wst.xml.core.internal.contentmodel.modelquery.ModelQuery


   * You cannot always retrieve HTMLElementDeclaration via an Element instance.
   * Because, it occasionally a JSP custom tag. -- 9/7/2001
   */
  public static CMElementDeclaration getDeclaration(Element target) {
    Document doc = target.getOwnerDocument();
    ModelQuery query = ModelQueryUtil.getModelQuery(doc);
    return query.getCMElementDeclaration(target);
  }
View Full Code Here


   * @see ModelQuery#getCMElementDeclaration(Element)
   */
  public CMElementDeclaration getCMElementDeclaration(Element element) {
    CMElementDeclaration result = super.getCMElementDeclaration(element);
    if (result == null) {
      ModelQuery query = getEmbeddedModelQuery(element);
      if (query != null) {
        result = query.getCMElementDeclaration(element);
      }
    }
    return result;
  }
View Full Code Here

   * @see ModelQuery#getCorrespondingCMDocument(Node)
   */
  public CMDocument getCorrespondingCMDocument(Node node) {
    CMDocument doc = super.getCorrespondingCMDocument(node);
    if (doc == null) {
      ModelQuery query = getEmbeddedModelQuery(node);
      if (query != null) {
        doc = query.getCorrespondingCMDocument(node);
      }
    }
    return doc;
  }
View Full Code Here

   * @see ModelQuery#getCMNode(Node)
   */
  public CMNode getCMNode(Node node) {
    CMNode result = super.getCMNode(node);
    if (result == null) {
      ModelQuery query = getEmbeddedModelQuery(node);
      if (query != null) {
        result = query.getCMNode(node);
      }
    }
    return result;
  }
View Full Code Here

    }
    return result;
  }

  public List getAvailableContent(Element element, CMElementDeclaration ed, int includeOptions) {
    ModelQuery emq = getEmbeddedModelQuery(element);
    if (emq != null)
      return emq.getAvailableContent(element, ed, includeOptions);
    else
      return super.getAvailableContent(element, ed, includeOptions);
  }
View Full Code Here

      return super.getAvailableContent(element, ed, includeOptions);
  }

  // ISSUE: shouldn't this be private?
  protected ModelQuery getEmbeddedModelQuery(Node node) {
    ModelQuery embeddedModelQuery = null;

    if (node instanceof INodeNotifier) {
      Node ownerNode = node.getOwnerDocument();
      if (ownerNode == null) {
        // then must be the document itself
        ownerNode = node;
      }
      PageDirectiveAdapter pageDirectiveAdapter = (PageDirectiveAdapter) ((INodeNotifier) ownerNode).getAdapterFor(PageDirectiveAdapter.class);
      if (pageDirectiveAdapter != null) {

        String effectiveContentType = null;
        ModelQuery potentialModelQueryObject = null;

        String familyId = pageDirectiveAdapter.getEmbeddedType().getFamilyId();
        if (ContentTypeFamilyForHTML.HTML_FAMILY.equals(familyId)) {
          effectiveContentType = "text/html";
        }
View Full Code Here

   * @see org.eclipse.wst.xml.core.internal.contentmodel.modelquery.ModelQuery#getCMAttributeDeclaration(org.w3c.dom.Attr)
   */
  public CMAttributeDeclaration getCMAttributeDeclaration(Attr attr) {
    CMAttributeDeclaration result = super.getCMAttributeDeclaration(attr);
    if (result == null) {
      ModelQuery query = getEmbeddedModelQuery(attr);
      if (query != null) {
        result = query.getCMAttributeDeclaration(attr);
      }
    }
    return result;
  }
View Full Code Here

  private static Collection getAncestorDeclarations(Element target) {
    Vector ancestors = new Vector();

    Document doc = target.getOwnerDocument();
    ModelQuery query = ModelQueryUtil.getModelQuery(doc);
    CMElementDeclaration decl = query.getCMElementDeclaration(target);
    ancestors.add(decl);

    Element parent = getParent(target);
    while (parent != null) {
      decl = query.getCMElementDeclaration(parent);
      if (decl != null)
        ancestors.add(decl);
      parent = getParent(parent);
    }
    return ancestors;
View Full Code Here

            }
          }
          idResolver = new XMLCatalogIdResolver(baseLocation, null);
        }
        CMDocumentCache documentCache = new CMDocumentCache();
        ModelQuery modelQuery = new HTMLModelQueryImpl(documentCache, idResolver);
        modelQuery.setEditMode(ModelQuery.EDIT_MODE_UNCONSTRAINED);
        modelQueryAdapter = new ModelQueryAdapterImpl(documentCache, modelQuery, idResolver);
      }
    }
    return modelQueryAdapter;
  }
View Full Code Here

    boolean isIterationTag = false;
    String tagClass = null;
    String teiClass = null;
    if (problems == null)
      problems = new ArrayList();
    ModelQuery mq = getModelQuery(structuredDoc);
    if (mq != null) {
      TLDCMDocumentManager mgr = TaglibController.getTLDCMDocumentManager(structuredDoc);

      if (mgr != null) {
View Full Code Here

TOP

Related Classes of org.eclipse.wst.xml.core.internal.contentmodel.modelquery.ModelQuery

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.