Examples of IProblemRequestorExtension


Examples of org.eclipse.dltk.internal.ui.text.IProblemRequestorExtension

   * @since 3.4
   */
  private Program reconcile(ISourceModule unit, boolean initialReconcile)
      throws ModelException {
    /* fix for missing cancel flag communication */
    IProblemRequestorExtension extension = getProblemRequestorExtension();
    if (extension != null) {
      extension.setProgressMonitor(fProgressMonitor);
      extension.setIsActive(true);
    }

    try {
      final ASTProvider astProvider = PHPUiPlugin.getDefault()
          .getASTProvider();

      synchronized (unit) {
        unit.reconcile(true, null, fProgressMonitor);
      }

      // read DOM AST from provider if avaiable
      Program createdAST = astProvider.getAST(unit,
          SharedASTProvider.WAIT_NO, fProgressMonitor);
      if (astProvider.isActive(unit) && createdAST != null) {
        return createdAST;
      }

      if (initialReconcile || astProvider.isActive(unit)) {
        PHPVersion phpVersion = ProjectOptions.getPhpVersion(unit
            .getScriptProject().getProject());
        ASTParser newParser = ASTParser.newParser(phpVersion, unit);
        createdAST = newParser.createAST(null);
        if (createdAST != null && document != null) {
          createdAST.setSourceModule(unit);
          createdAST.setSourceRange(0, document.getLength());
          createdAST.setLineEndTable(Util.lineEndTable(document));
        }
        return createdAST;
      }

    } catch (OperationCanceledException ex) {
      Assert.isTrue(fProgressMonitor == null
          || fProgressMonitor.isCanceled());

    } catch (Exception e) {
      throw new ModelException(e, IStatus.ERROR);

    } finally {
      /* fix for missing cancel flag communication */
      if (extension != null) {
        extension.setProgressMonitor(null);
        extension.setIsActive(false);
      }
    }

    return null;
  }
View Full Code Here

Examples of org.eclipse.jdt.internal.ui.text.java.IProblemRequestorExtension

    protected void enableHandlingTemporaryProblems() {
        boolean enable = isHandlingTemporaryProblems();
        for (Iterator iter = getFileInfosIterator(); iter.hasNext();) {
            FileInfo info = (FileInfo) iter.next();
            if (info.fModel instanceof IProblemRequestorExtension) {
                IProblemRequestorExtension extension = (IProblemRequestorExtension) info.fModel;
                extension.setIsHandlingTemporaryProblems(enable);
            }
        }
    }
View Full Code Here

Examples of org.eclipse.jdt.internal.ui.text.java.IProblemRequestorExtension

    protected FileInfo createFileInfo(Object element) throws CoreException {
        FileInfo info = super.createFileInfo(element);

        IAnnotationModel requestor = info.fModel;
        if (requestor instanceof IProblemRequestorExtension) {
            IProblemRequestorExtension extension = (IProblemRequestorExtension) requestor;
            extension.setIsActive(false);
            extension.setIsHandlingTemporaryProblems(isHandlingTemporaryProblems());
        }

        return info;
    }
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.