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

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


   * Return the {@link CMElementDeclaration} defined for the given node.
   */
  protected 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


          // attached meta data and not the concrete element data
          Node node = nodes.item(0);

          // Look for meta data. The query returns null in case no XSD
          // can be found.
          ModelQuery modelQuery = ModelQueryUtil.getModelQuery(document);
          if (modelQuery != null) {

            // Get the element declaration from the model query.
            CMElementDeclaration result = modelQuery
                .getCMElementDeclaration((Element) node);

            // If the XSD is not found this check will fail.
            if (result instanceof XSDElementDeclarationAdapter) {
              XSDElementDeclarationImpl elementDeclaration = (XSDElementDeclarationImpl) ((XSDElementDeclarationAdapter) result)
View Full Code Here

      factoryRegistry.addFactory(factory);
    }

    // Stuff from super method (inferred grammar support)
    if (structuredModel != null) {
      ModelQuery modelQuery = ModelQueryUtil.getModelQuery(structuredModel);
      if (modelQuery != null) {
        CMDocumentManager documentManager = modelQuery.getCMDocumentManager();
        if (documentManager != null) {
          IPreferenceStore store = XMLUIPlugin.getDefault().getPreferenceStore();
          boolean useInferredGrammar = (store != null) ? store
              .getBoolean(XMLUIPreferenceNames.USE_INFERRED_GRAMMAR) : true;
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.