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

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


        return new ArrayList(0);
      }
    }

    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);
View Full Code Here


   */
  private List getAvailableModelQueryActionsAtIndex(Element parent, int index, int validityChecking) {
    List list = new ArrayList();
    CMElementDeclaration parentDecl = getCMElementDeclaration(parent);
    if (parentDecl != null) {
      ModelQuery modelQuery = ModelQueryUtil.getModelQuery(parent.getOwnerDocument());
      // taken from ActionManagers
      // int editMode = modelQuery.getEditMode();
      int editMode = ModelQuery.EDIT_MODE_UNCONSTRAINED;
      int ic = (editMode == ModelQuery.EDIT_MODE_CONSTRAINED_STRICT) ? ModelQuery.INCLUDE_CHILD_NODES | ModelQuery.INCLUDE_SEQUENCE_GROUPS : ModelQuery.INCLUDE_CHILD_NODES;
      modelQuery.getInsertActions(parent, parentDecl, index, ic, validityChecking, list);
    }
   
    list = filterAvailableModelQueryActions(list);
    return list;
  }
View Full Code Here

  }
 
  public static CMElementDeclaration getCMElementDeclaration(Node node) {
    CMElementDeclaration result = null;
    if (node.getNodeType() == Node.ELEMENT_NODE) {
      ModelQuery modelQuery = ModelQueryUtil.getModelQuery(node.getOwnerDocument());
      if (modelQuery != null) {
        result = modelQuery.getCMElementDeclaration((Element) node);
      }
    }
    return result;
  }
View Full Code Here

      String tagName) {
    if (host == null)
      return false;
    Node node = (Node) host.getModel();
    if (node.getNodeType() == Node.ELEMENT_NODE) {
      ModelQuery modelQuery = getModelQuery(node);
      if (modelQuery != null) {
        CMElementDeclaration elementDecl = modelQuery
            .getCMElementDeclaration((Element) node);
        if (elementDecl == null) {
          return true;
        }
        if (elementDecl.getContentType() == CMElementDeclaration.EMPTY)
View Full Code Here

    CMElementDeclaration cmde = null;
    CMNamedNodeMap cmnnm = null;
    if (fNode == null || fNode.getNodeType() != Node.ELEMENT_NODE) {
      cmde = null;
    }
    ModelQuery modelQuery = ModelQueryUtil.getModelQuery(fNode
        .getOwnerDocument());
    if (modelQuery != null) {
      cmde = modelQuery.getCMElementDeclaration((Element) fNode);
    }
    if (cmde != null) {
      cmnnm = cmde.getAttributes();
    }
    return cmnnm;
View Full Code Here

   * ModelQueryImpl#getCMElementDeclaration(org.w3c.dom.Element)
   */
  public CMElementDeclaration getCMElementDeclaration(Element element) {
    CMElementDeclaration cmElementDeclaration = super.getCMElementDeclaration(element);
    if (cmElementDeclaration == null) {
      ModelQuery embeddedModelQuery = getEmbeddedModelQuery(element);
      if (embeddedModelQuery != null) {
        return embeddedModelQuery.getCMElementDeclaration(element);
      }
    }
    return cmElementDeclaration;
  }
View Full Code Here

   * 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);
      }
    }
    return document;
  }
View Full Code Here

    if (element == null)
      return null;
    Document document = element.getOwnerDocument();
    if (document == null)
      return null;
    ModelQuery modelQuery = ModelQueryUtil.getModelQuery(document);
    if (modelQuery == null)
      return null;
    return modelQuery.getCMElementDeclaration(element);
  }
View Full Code Here

import org.w3c.dom.NamedNodeMap;

public class CommentElementHandlerForSSI implements CommentElementHandler {

  public Element createElement(Document document, String data, boolean isJSPTag) {
    ModelQuery modelQuery = ModelQueryUtil.getModelQuery(document);
    if (modelQuery == null) {
      return null;
    }
    CMDocument cm = modelQuery.getCorrespondingCMDocument(document);
    if (cm == null) {
      return null;
    }
    CMNamedNodeMap map = cm.getElements();
    if (map == null) {
View Full Code Here

  public boolean isCommentElement(IDOMElement element) {
    if (element == null) {
      return false;
    }
    Document document = element.getOwnerDocument();
    ModelQuery modelQuery = ModelQueryUtil.getModelQuery(document);
    if (modelQuery == null) {
      return false;
    }
    CMDocument cm = modelQuery.getCorrespondingCMDocument(document);
    if (cm == null) {
      return false;
    }
    CMNamedNodeMap map = cm.getElements();
    if (map == 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.