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

Examples of org.eclipse.wst.xml.core.internal.provisional.document.IDOMDocument


    return model;
  }

  private ModelQueryAdapter getModelQueryAdapter(IStructuredModel model) {
    IDOMDocument document = ((IDOMModel) model).getDocument();

    ModelQueryAdapter modelQueryAdapter = (ModelQueryAdapter) ((INodeNotifier) document).getAdapterFor(ModelQueryAdapter.class);
    return modelQueryAdapter;
  }
View Full Code Here


    IStructuredModel m = null;
    try {
      m = StructuredModelManager.getModelManager().getModelForRead(tld);
      if (m != null && m instanceof IDOMModel) {
        IDOMDocument document = ((IDOMModel) m).getDocument();

        for (int i = 0; i < classElementNames.length; i++) {
          NodeList classes = document.getElementsByTagName(classElementNames[i]);
          for (int j = 0; j < classes.getLength(); j++) {
            Map problem = checkClass(javaProject, classes.item(j), preferenceScopes, missingClassSeverityPreferenceKeys[i], missingClassMessages[i]);
            if (problem != null)
              problems.add(problem);
          }
View Full Code Here

    }
    if (model instanceof IDOMModel) {
      IDOMModel domModel = (IDOMModel) model;
      ModelHandlerForJSP.ensureTranslationAdapterFactory(domModel);

      IDOMDocument xmlDoc = domModel.getDocument();
      JSPTranslationAdapter translationAdapter = (JSPTranslationAdapter) xmlDoc.getAdapterFor(IJSPTranslation.class);
      IJSPTranslation translation = translationAdapter.getJSPTranslation();

      if (!reporter.isCancelled()) {
        loadPreferences(f);
View Full Code Here

  protected void addPropagatingAdapters(IStructuredModel structuredModel) {

    if (structuredModel instanceof IDOMModel) {
      IDOMModel xmlModel = (IDOMModel) structuredModel;
      IDOMDocument document = xmlModel.getDocument();
      PropagatingAdapter propagatingAdapter = (PropagatingAdapter) document.getAdapterFor(PropagatingAdapter.class);
      if (propagatingAdapter != null) {
        // what to do?
      }
    }
  }
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

    String baseHref = null;
    // dmw_TODO needs to be changed to handle a content model
    // of HTML or XHTML
    if (isHTMLFamily(baseModel)) {
      final IDOMModel xmlmodel = (IDOMModel) baseModel;
      final IDOMDocument doc = xmlmodel.getDocument();
      // look for <BASE> w/ href
      final NodeList nl = doc.getElementsByTagName("BASE");//$NON-NLS-1$
      if ((nl != null) && (nl.getLength() > 0)) {
        // per each <BASE>
        for (int i = 0; i < nl.getLength(); i++) {
          final Node baseNode = nl.item(i);
          if (baseNode != null) {
View Full Code Here

    IStructuredModel model = null;
    JSPTranslator translator = null;
    try {
      model = StructuredModelManager.getModelManager().getModelForRead(jspFile);
      if(model instanceof IDOMModel) {
        IDOMDocument doc = ((IDOMModel)model).getDocument();
        ModelHandlerForJSP.ensureTranslationAdapterFactory(model);
        JSPTranslationAdapter adapter = (JSPTranslationAdapter)doc.getAdapterFor(IJSPTranslation.class);
       
        //don't want to persist a translator that has not already been requested
        if(adapter != null && adapter.hasTranslation()) {
          translator = adapter.getJSPTranslation().getTranslator();
        }
View Full Code Here

  public JSPTranslationExtension getTranslation() {
    if (fTranslation == null) {
      IDOMModel xmlModel = (IDOMModel) getModelManager().getExistingModelForRead(fDocument);
      ModelHandlerForJSP.ensureTranslationAdapterFactory(xmlModel);
      try {
        IDOMDocument xmlDoc = xmlModel.getDocument();

        JSPTranslationAdapter translationAdapter = (JSPTranslationAdapter) xmlDoc.getAdapterFor(IJSPTranslation.class);
        if (translationAdapter != null)
          fTranslation = translationAdapter.getJSPTranslation();
      }
      finally {
        if (xmlModel != null) {
View Full Code Here

  protected boolean isXMLType(IDOMModel structuredModel) {
    boolean result = false;

    if (structuredModel != null) {
      IDOMDocument document = structuredModel.getDocument();

      if (document != null)
        result = document.isXMLType();
    }

    return result;
  }
View Full Code Here

    IDOMModel xmlModel = null;
    try {
      xmlModel = (IDOMModel) StructuredModelManager.getModelManager().getExistingModelForRead(document);
      if (xmlModel != null) {
        IDOMDocument xmlDoc = xmlModel.getDocument();
        JSPTranslationAdapter adapter = (JSPTranslationAdapter) xmlDoc.getAdapterFor(IJSPTranslation.class);
        if (adapter != null) {
          translation = adapter.getJSPTranslation();
        }
      }
    }
View Full Code Here

TOP

Related Classes of org.eclipse.wst.xml.core.internal.provisional.document.IDOMDocument

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.