Examples of IDOMDocument


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

    IStructuredModel sModel = StructuredModelManager.getModelManager().getExistingModelForRead(doc);
    try {
      if (sModel != null) {
        if (!isXml) {
          if (sModel instanceof IDOMModel) {
            IDOMDocument documentNode = ((IDOMModel) sModel).getDocument();
            Element docElement = documentNode.getDocumentElement();
            isXml = docElement != null && ((docElement.getNodeName().equals("jsp:root")) || docElement.getAttributeNode("xmlns:jsp") != null || ((((IDOMNode) docElement).getStartStructuredDocumentRegion() == null && ((IDOMNode) docElement).getEndStructuredDocumentRegion() == null))); //$NON-NLS-1$  //$NON-NLS-2$
          }
        }
      }
    }
View Full Code Here

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

    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

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

    Element root = document.getDocumentElement();
    return root != null && (root.hasAttribute(XMLNS_JSP) || HTTP_JAVA_SUN_COM_JSP_PAGE.equals(root.getAttribute(XMLNS)));
  }

  private void validate(IFile file, int kind, ValidationState state, IProgressMonitor monitor, IDOMModel model, IReporter reporter) {
    IDOMDocument document = model.getDocument();
    if (document == null)
      return; // error

    boolean isXMLJSP = isXMLJSP(document);
    boolean hasHTMLFeature = hasHTMLFeature(document);
View Full Code Here

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

   * Mostly copied from HTMLValidator
   */
  private void validate(IReporter reporter, IFile file, IDOMModel model) {
    if (file == null || model == null)
      return; // error
    IDOMDocument document = model.getDocument();
    if (document == null)
      return; // error

    // This validator currently only handles validating HTML content in
    // JSP
View Full Code Here

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

    IJavaElement[] elements = new IJavaElement[0];
    // get JSP translation object for this viewer's document
    IStructuredModel model = StructuredModelManager.getModelManager().getExistingModelForRead(document);
    try {
      if (model != null && model instanceof IDOMModel) {
        IDOMDocument xmlDoc = ((IDOMModel) model).getDocument();
        JSPTranslationAdapter adapter = (JSPTranslationAdapter) xmlDoc.getAdapterFor(IJSPTranslation.class);
        if (adapter != null) {
          JSPTranslation translation = adapter.getJSPTranslation();

          // https://bugs.eclipse.org/bugs/show_bug.cgi?id=102211
          elements = translation.getElementsFromJspRange(selection.getOffset(), selection.getOffset() + selection.getLength());
View Full Code Here

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

    if (model == null)
      return; // error

    try {

      IDOMDocument document = null;
      if (model instanceof IDOMModel) {
        document = ((IDOMModel) model).getDocument();
      }

      if (document == null || !hasHTMLFeature(document))
View Full Code Here

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

  public String getHoverInfo(ITextViewer textViewer, IRegion hoverRegion) {
    // get JSP translation object for this viewer's document
    IDOMModel xmlModel = (IDOMModel) StructuredModelManager.getModelManager().getExistingModelForRead(textViewer.getDocument());
    try {
      if (xmlModel != null) {
        IDOMDocument xmlDoc = xmlModel.getDocument();
        JSPTranslationAdapter adapter = (JSPTranslationAdapter) xmlDoc.getAdapterFor(IJSPTranslation.class);
        if (adapter != null) {
          JSPTranslation translation = adapter.getJSPTranslation();
         
          IJavaElement[] result = translation.getElementsFromJspRange(hoverRegion.getOffset(), hoverRegion.getOffset() + hoverRegion.getLength());
          return translation.fixupMangledName(getHoverInfo(result));
View Full Code Here

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

  protected IStructuredCleanupPreferences fCleanupPreferences = null;
 
  public void cleanupModel(IStructuredModel structuredModel) {
    Preferences preferences = getModelPreferences();
    if (preferences != null && preferences.getBoolean(XMLCorePreferenceNames.FIX_XML_DECLARATION)) {
      IDOMDocument document = ((DOMModelImpl) structuredModel).getDocument();
      if (!fixExistingXmlDecl(document)) {
        String encoding = preferences.getString(CommonEncodingPreferenceNames.OUTPUT_CODESET);
        Node xml = document.createProcessingInstruction("xml", "version=\"1.0\" " + "encoding=\"" + encoding +"\""); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$
        document.insertBefore(xml, document.getFirstChild());
      }
    }
    super.cleanupModel(structuredModel);
  }
View Full Code Here

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

      if (viewer instanceof StructuredTextViewer)
        fViewer = (StructuredTextViewer) viewer;

      xmlModel = (IDOMModel) StructuredModelManager.getModelManager().getExistingModelForRead(fViewer.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

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

    {
        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
TOP
Copyright © 2018 www.massapi.com. 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.