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

Examples of org.eclipse.wst.xml.core.internal.document.DocumentTypeAdapter


  /*
   * Copied from HTMLValidator
   */
  private boolean hasHTMLFeature(IDOMDocument document) {
    DocumentTypeAdapter adapter = (DocumentTypeAdapter) document.getAdapterFor(DocumentTypeAdapter.class);
    if (adapter == null)
      return false;
    return adapter.hasFeature(HTMLDocumentTypeConstants.HTML);
  }
View Full Code Here


        return false;
      return ((Element) node).getTagName().equalsIgnoreCase(tagName);
    }

    private static String getRootTagName(Document document) {
      DocumentTypeAdapter adapter = (DocumentTypeAdapter) ((IDOMDocument) document).getAdapterFor(DocumentTypeAdapter.class);
      if (adapter != null) {
        DocumentType docType = adapter.getDocumentType();
        if (docType != null) {
          return docType.getName();
        }
      }
View Full Code Here

      // if already has an adapter, no need to recreate/initialize.
      // Note: this means if "doctype" for DOM changes,
      // theDocumentTypeAdatper for that DOM
      // should be removed (and released) and it will be re-created next
      // time required.
      DocumentTypeAdapter oldAdapter = (DocumentTypeAdapter) notifier.getExistingAdapter(DocumentTypeAdapter.class);
      if (oldAdapter != null) {
        result = oldAdapter;
      }
      else {
       
View Full Code Here

   */
  public void release() {
   
    if(!fDoc2AdapterMap.isEmpty()) {
      Object[] docs = fDoc2AdapterMap.keySet().toArray();
      DocumentTypeAdapter adapter = null;
      for (int i = 0; i < docs.length; i++) {
        adapter = (DocumentTypeAdapter)fDoc2AdapterMap.get(docs[i]);
        adapter.release();
        ((IDOMDocument)docs[i]).removeAdapter(adapter);
      }
      fDoc2AdapterMap.clear();
    }
   
View Full Code Here

   * Utility to check the model is HTML family or not
   */
  static private boolean isHTMLFamily(IStructuredModel model) {
    if (model instanceof IDOMModel) {
      IDOMDocument document = ((IDOMModel) model).getDocument();
      DocumentTypeAdapter adapter = (DocumentTypeAdapter) document.getAdapterFor(DocumentTypeAdapter.class);
      if (adapter != null)
        return adapter.hasFeature(HTMLDocumentTypeConstants.HTML);
    }
    return false;
  }
View Full Code Here

  /*
   * Copied from HTMLValidator
   */
  private boolean hasHTMLFeature(IDOMDocument document) {
    DocumentTypeAdapter adapter = (DocumentTypeAdapter) document.getAdapterFor(DocumentTypeAdapter.class);
    if (adapter == null)
      return false;
    return adapter.hasFeature(HTMLDocumentTypeConstants.HTML);
  }
View Full Code Here

    }
    return indexedRegion;
  }

  private boolean hasHTMLFeature(IDOMDocument document) {
    DocumentTypeAdapter adapter = (DocumentTypeAdapter) document.getAdapterFor(DocumentTypeAdapter.class);
    if (adapter == null)
      return false;
    return adapter.hasFeature(HTMLDocumentTypeConstants.HTML);
  }
View Full Code Here

  private boolean initCaseSensitive(Node node) {
    // almost all tags are case sensitive, except that old HTML
    boolean caseSensitive = true;
    if (node instanceof IDOMNode) {
      DocumentTypeAdapter adapter = getDocTypeFromDOMNode(node);
      if (adapter != null) {
        caseSensitive = (adapter.getTagNameCase() == DocumentTypeAdapter.STRICT_CASE);
      }
    }
    return caseSensitive;
  }
View Full Code Here

   * Node
   *
   * @return {@link DocumentTypeAdapter}
   */
  private DocumentTypeAdapter getDocTypeFromDOMNode(Node node) {
    DocumentTypeAdapter adapter = null;
    Document ownerDocument = node.getOwnerDocument();
    if (ownerDocument == null) {
      // if ownerDocument is null, then fNode must be the Document Node
      // [old, old comment]
      // hmmmm, guess not. See
View Full Code Here

TOP

Related Classes of org.eclipse.wst.xml.core.internal.document.DocumentTypeAdapter

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.