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

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


      // get the JSP translation object for this editor's document
      IStructuredModel model = StructuredModelManager.getModelManager().getExistingModelForRead(document);
      try {
        if (model instanceof IDOMModel) {
          IDOMModel xmlModel = (IDOMModel)model;
          IDOMDocument xmlDoc = xmlModel.getDocument();

          JSPTranslationAdapter adapter = (JSPTranslationAdapter) xmlDoc.getAdapterFor(IJSPTranslation.class);
          if (adapter != null) {
            JSPTranslation translation = adapter.getJSPTranslation();
            elements = translation.getElementsFromJspRange(textSelection.getOffset(), textSelection.getOffset() + textSelection.getLength());
          }
        }
View Full Code Here


   
    IDOMModel xmlModel = null;
    try {
      xmlModel = (IDOMModel) StructuredModelManager.getModelManager().getExistingModelForRead(viewer.getDocument());

      IDOMDocument xmlDoc = xmlModel.getDocument();
      if (fTranslationAdapter == null || xmlModel.getId() != fModelId) {
        fTranslationAdapter = (JSPTranslationAdapter) xmlDoc.getAdapterFor(IJSPTranslation.class);
        fModelId = xmlModel.getId();
      }
      if (fTranslationAdapter != null) {

        JSPTranslation translation = fTranslationAdapter.getJSPTranslation();
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

      }
      // handle unsupported
      if (model instanceof IDOMModel) {
        IDOMModel xmlModel = (IDOMModel)model;
        setupAdapterFactory(xmlModel);
        IDOMDocument doc = xmlModel.getDocument();
        JSPTranslationAdapter adapter = (JSPTranslationAdapter) doc.getAdapterFor(IJSPTranslation.class);
        translation = adapter.getJSPTranslation();
      }
    }
    catch (IOException e) {
      Logger.logException(e);
View Full Code Here

  private 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(viewer.getDocument());

      IDOMDocument xmlDoc = xmlModel.getDocument();
      if (fTranslationAdapter == null || xmlModel.getId() != fModelId) {
        fTranslationAdapter = (JSPTranslationAdapter) xmlDoc.getAdapterFor(IJSPTranslation.class);
        fModelId = xmlModel.getId();
      }
      if (fTranslationAdapter != null) {

        JSPTranslation translation = fTranslationAdapter.getJSPTranslation();
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

        updateActionsWhenModelChange();
      }
    }

    if (model instanceof IDOMModel) {
      IDOMDocument doc = ((IDOMModel) model).getDocument();
      PropagatingAdapter adapter = (PropagatingAdapter) doc
          .getAdapterFor(PropagatingAdapter.class);
      if (adapter != null) {
        INodeAdapterFactory factory = RefresherFactory.getInstance();
        adapter.addAdaptOnCreateFactory(factory);
        adapter.initializeForFactory(factory, doc);
        // CSSStyleAdapterFactory fac2 =
        // CSSStyleAdapterFactory.getInstance();
        // adapter.addAdaptOnCreateFactory(fac2);
        // adapter.initializeForFactory(fac2, doc);
      }
      ((IDOMModel) model).getFactoryRegistry().addFactory(
          CSSStyleAdapterFactory.getInstance());

      // _viewer.getDestDocumentForDesign().getModel().getFactoryRegistry().addFactory(CSSStyleAdapterFactory.getInstance());
      ((IDOMModel) model).getFactoryRegistry().addFactory(
          new PageVariableAdapterFactory());
      doc.addAdapter(new DocumentPageVariableAdapter(doc));
      _viewer.setContents(((IDOMModel) model).getDocument());
    } else {
      _viewer.setContents((EditPart) null);
    }
  }
View Full Code Here

    {
        final IStructuredDocumentContext context =
            IStructuredDocumentContextFactory.INSTANCE.getContext(model.getStructuredDocument(), -1);
        final ITaglibContextResolver taglibResolver =
            IStructuredDocumentContextResolverFactory.INSTANCE.getTaglibContextResolver(context);
        final IDOMDocument document = model.getDocument();
        getApplicationMap().clear();
        getRequestMap().clear();
        getSessionMap().clear();

        if (taglibResolver == null) {
            // unusual, but protect against possible NPE
            JSFCorePlugin.log(IStatus.ERROR, "Program Error: taglib resolver is null."); //$NON-NLS-1$
            return;
        }

        //long curTime = System.currentTimeMillis();
        recurseChildNodes(model, document.getChildNodes(), taglibResolver);
        //long netTime = System.currentTimeMillis() - curTime;
        //System.out.println("Net time to recurse document: "+netTime);
    }
View Full Code Here

    int pos = 0;
    IStructuredModel sModel = StructuredModelManager.getModelManager().getExistingModelForRead(doc);
    try {
      if (sModel != null) {
        if (sModel instanceof IDOMModel) {
          IDOMDocument documentNode = ((IDOMModel) sModel).getDocument();
          /*
           * document element must be sole Element child of Document
           * to remain valid
           */
          Node targetElement = null;
          if (isXml) {
            targetElement = documentNode.getDocumentElement();
          }
          if (targetElement == null)
            targetElement = getInsertNode(documentNode);
          if (targetElement != null) {
            IStructuredDocumentRegion sdRegion = ((IDOMNode) targetElement).getFirstStructuredDocumentRegion();
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.