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

Examples of org.eclipse.wst.xml.core.internal.ssemodelquery.ModelQueryAdapter


      }

      // 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();

          /*
 
View Full Code Here


    //only returns anything if looking for child nodes
    if(((includeOptions & ModelQuery.INCLUDE_CHILD_NODES) != 0) && parentElement instanceof IDOMNode) {
      IDOMNode node = (IDOMNode)parentElement;
      // get position dependent CMDocuments and insert their tags as
      // proposals
      ModelQueryAdapter mqAdapter = null;
      if (node.getNodeType() == Node.DOCUMENT_NODE) {
        mqAdapter = (ModelQueryAdapter) 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(node);
          CMNamedNodeMap jspelements = jcmdoc.getElements();

          /* For a built-in JSP action the content model is properly
View Full Code Here

  protected void initAdapter(INodeAdapter adapter, INodeNotifier node) {
    Assert.isTrue(cmDocumentManager == null);
    Assert.isTrue(fCMDocumentManagerListener == null);

    // register for CMDocumentManager events
    ModelQueryAdapter mqadapter = (ModelQueryAdapter) node.getAdapterFor(ModelQueryAdapter.class);
    if (mqadapter != null) {
      ModelQuery mquery = mqadapter.getModelQuery();
      if ((mquery != null) && (mquery.getCMDocumentManager() != null)) {
        cmDocumentManager = mquery.getCMDocumentManager();
        fCMDocumentManagerListener = new CMDocumentManagerListenerImpl();
        cmDocumentManager.addListener(fCMDocumentManagerListener);
      }
View Full Code Here

* Document (or IStructuredModel).
*/
public class ModelQueryUtil {

  public static CMDocumentCache getCMDocumentCache(Document node) {
    ModelQueryAdapter modelQueryAdapter = getModelQueryAdapter(node);
    return modelQueryAdapter != null ? modelQueryAdapter.getCMDocumentCache() : null;
  }
View Full Code Here

    ModelQueryAdapter modelQueryAdapter = getModelQueryAdapter(node);
    return modelQueryAdapter != null ? modelQueryAdapter.getCMDocumentCache() : null;
  }

  public static URIResolver getIdResolver(Document node) {
    ModelQueryAdapter modelQueryAdapter = getModelQueryAdapter(node);
    return modelQueryAdapter != null ? modelQueryAdapter.getIdResolver() : null;
  }
View Full Code Here

    ModelQueryAdapter modelQueryAdapter = getModelQueryAdapter(node);
    return modelQueryAdapter != null ? modelQueryAdapter.getIdResolver() : null;
  }

  public static ModelQuery getModelQuery(Document node) {
    ModelQueryAdapter modelQueryAdapter = getModelQueryAdapter(node);
    return modelQueryAdapter != null ? modelQueryAdapter.getModelQuery() : null;
  }
View Full Code Here

      return null;
    return getModelQuery(((IDOMModel) model).getDocument());
  }

  public static ModelQueryAdapter getModelQueryAdapter(Document node) {
    ModelQueryAdapter result = null;

    if (node instanceof INodeNotifier) {
      INodeNotifier notifier = (INodeNotifier) node;
      result = (ModelQueryAdapter) notifier.getAdapterFor(ModelQueryAdapter.class);
    }
View Full Code Here

TOP

Related Classes of org.eclipse.wst.xml.core.internal.ssemodelquery.ModelQueryAdapter

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.