org.eclipse.ltk.core.refactoring.RefactoringStatus.addEntry()方法的使用及代码示例

x33g5p2x  于2022-01-29 转载在 其他  
字(12.2k)|赞(0)|评价(0)|浏览(59)

本文整理了Java中org.eclipse.ltk.core.refactoring.RefactoringStatus.addEntry方法的一些代码示例,展示了RefactoringStatus.addEntry的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。RefactoringStatus.addEntry方法的具体详情如下:
包路径:org.eclipse.ltk.core.refactoring.RefactoringStatus
类名称:RefactoringStatus
方法名:addEntry

RefactoringStatus.addEntry介绍

[英]Adds a new entry filled with the given arguments to this status. The severity of this status is set to the maximum of fSeverity and severity.
[中]将填充给定参数的新条目添加到此状态。此状态的严重性设置为最大fSeverityseverity

代码示例

代码示例来源:origin: org.eclipse.xtext/ui

public void add(int severity, String message, Exception exc, Logger log) {
  String formatted = format(message, exc);
  status.addEntry(new RefactoringStatusEntry(severity, formatted + ".\nSee log for details."));
  log.error(formatted, exc);
}

代码示例来源:origin: org.eclipse.scout.sdk.deps/org.eclipse.jdt.ui

private static void addStatusErrors(RefactoringStatus status, boolean hasPotentialMatches, boolean hasNonCuMatches) {
    if (hasPotentialMatches) {
      final RefactoringStatusEntry entry= new RefactoringStatusEntry(RefactoringStatus.ERROR, RefactoringCoreMessages.RefactoringSearchEngine_potential_matches);
      if (!containsStatusEntry(status, entry))
        status.addEntry(entry);
    }
    if (hasNonCuMatches) {
      final RefactoringStatusEntry entry= new RefactoringStatusEntry(RefactoringStatus.ERROR, RefactoringCoreMessages.RefactoringSearchEngine_non_cu_matches);
      if (!containsStatusEntry(status, entry))
        status.addEntry(entry);
    }
  }
}

代码示例来源:origin: org.eclipse.jdt/org.eclipse.jdt.ui

private static void addStatusErrors(RefactoringStatus status, boolean hasPotentialMatches, boolean hasNonCuMatches) {
    if (hasPotentialMatches) {
      final RefactoringStatusEntry entry= new RefactoringStatusEntry(RefactoringStatus.ERROR, RefactoringCoreMessages.RefactoringSearchEngine_potential_matches);
      if (!containsStatusEntry(status, entry))
        status.addEntry(entry);
    }
    if (hasNonCuMatches) {
      final RefactoringStatusEntry entry= new RefactoringStatusEntry(RefactoringStatus.ERROR, RefactoringCoreMessages.RefactoringSearchEngine_non_cu_matches);
      if (!containsStatusEntry(status, entry))
        status.addEntry(entry);
    }
  }
}

代码示例来源:origin: org.eclipse/org.eclipse.jdt.ui

private static void addStatusErrors(RefactoringStatus status, boolean hasPotentialMatches, boolean hasNonCuMatches) {
    if (hasPotentialMatches) {
      final RefactoringStatusEntry entry= new RefactoringStatusEntry(RefactoringStatus.ERROR, RefactoringCoreMessages.RefactoringSearchEngine_potential_matches);
      if (!containsStatusEntry(status, entry))
        status.addEntry(entry);
    }
    if (hasNonCuMatches) {
      final RefactoringStatusEntry entry= new RefactoringStatusEntry(RefactoringStatus.ERROR, RefactoringCoreMessages.RefactoringSearchEngine_non_cu_matches);
      if (!containsStatusEntry(status, entry))
        status.addEntry(entry);
    }
  }
}

代码示例来源:origin: org.eclipse/org.eclipse.jdt.ui

private void addEntry(RefactoringStatus result, String message, int code, int severity) {
  result.addEntry(new RefactoringStatusEntry(
    severity, message, 
    JavaStatusContext.create(fCUnit, fInvocation),
    Corext.getPluginId(),
    code, null));
}

代码示例来源:origin: org.eclipse.jdt/org.eclipse.jdt.ui

private void addEntry(RefactoringStatus result, String message, int code, int severity) {
  result.addEntry(new RefactoringStatusEntry(
    severity, message,
    JavaStatusContext.create(fCUnit, fInvocation),
    Corext.getPluginId(),
    code, null));
}

代码示例来源:origin: org.eclipse.scout.sdk.deps/org.eclipse.jdt.ui

private void addEntry(RefactoringStatus result, String message, int code, int severity) {
  result.addEntry(new RefactoringStatusEntry(
    severity, message,
    JavaStatusContext.create(fCUnit, fInvocation),
    Corext.getPluginId(),
    code, null));
}

代码示例来源:origin: org.eclipse.xtext/ui

public void add(int severity, String message, EObject element) {
  status.addEntry(new RefactoringStatusEntry(severity, format(message, element), createContext(element)));
}

代码示例来源:origin: eclipse/eclipse.jdt.ls

private void checkNewSource(SubProgressMonitor monitor, RefactoringStatus result) throws CoreException {
  String newCuSource = fChange.getPreviewContent(new NullProgressMonitor());
  CompilationUnit newCUNode = new RefactoringASTParser(IASTSharedValues.SHARED_AST_LEVEL).parse(newCuSource, fCu, true, true, monitor);
  IProblem[] newProblems = RefactoringAnalyzeUtil.getIntroducedCompileProblems(newCUNode, fCompilationUnitNode);
  for (int i = 0; i < newProblems.length; i++) {
    IProblem problem = newProblems[i];
    if (problem.isError()) {
      result.addEntry(new RefactoringStatusEntry((problem.isError() ? RefactoringStatus.ERROR : RefactoringStatus.WARNING), problem.getMessage(), new JavaStringStatusContext(newCuSource, SourceRangeFactory.create(problem))));
    }
  }
}

代码示例来源:origin: org.eclipse.jdt/org.eclipse.jdt.ui

private void checkNewSource(SubProgressMonitor monitor, RefactoringStatus result) throws CoreException {
  String newCuSource= fChange.getPreviewContent(new NullProgressMonitor());
  CompilationUnit newCUNode= new RefactoringASTParser(IASTSharedValues.SHARED_AST_LEVEL).parse(newCuSource, fCu, true, true, monitor);
  IProblem[] newProblems= RefactoringAnalyzeUtil.getIntroducedCompileProblems(newCUNode, fCompilationUnitNode);
  for (int i= 0; i < newProblems.length; i++) {
    IProblem problem= newProblems[i];
    if (problem.isError())
      result.addEntry(new RefactoringStatusEntry((problem.isError() ? RefactoringStatus.ERROR : RefactoringStatus.WARNING), problem.getMessage(), new JavaStringStatusContext(newCuSource, SourceRangeFactory.create(problem))));
  }
}

代码示例来源:origin: org.eclipse.scout.sdk.deps/org.eclipse.jdt.ui

private void checkNewSource(SubProgressMonitor monitor, RefactoringStatus result) throws CoreException {
  String newCuSource= fChange.getPreviewContent(new NullProgressMonitor());
  CompilationUnit newCUNode= new RefactoringASTParser(ASTProvider.SHARED_AST_LEVEL).parse(newCuSource, fCu, true, true, monitor);
  IProblem[] newProblems= RefactoringAnalyzeUtil.getIntroducedCompileProblems(newCUNode, fCompilationUnitNode);
  for (int i= 0; i < newProblems.length; i++) {
    IProblem problem= newProblems[i];
    if (problem.isError())
      result.addEntry(new RefactoringStatusEntry((problem.isError() ? RefactoringStatus.ERROR : RefactoringStatus.WARNING), problem.getMessage(), new JavaStringStatusContext(newCuSource, SourceRangeFactory.create(problem))));
  }
}

代码示例来源:origin: org.eclipse.scout.sdk.deps/org.eclipse.jdt.ui

private void checkSource(SubProgressMonitor monitor, RefactoringStatus result) throws CoreException {
  String newCuSource= fChange.getPreviewContent(new NullProgressMonitor());
  CompilationUnit newCUNode= new RefactoringASTParser(ASTProvider.SHARED_AST_LEVEL).parse(newCuSource, fCu, true, true, monitor);
  IProblem[] newProblems= RefactoringAnalyzeUtil.getIntroducedCompileProblems(newCUNode, fCuRewrite.getRoot());
  for (int i= 0; i < newProblems.length; i++) {
    IProblem problem= newProblems[i];
    if (problem.isError())
      result.addEntry(new RefactoringStatusEntry((problem.isError() ? RefactoringStatus.ERROR : RefactoringStatus.WARNING), problem.getMessage(), new JavaStringStatusContext(newCuSource, SourceRangeFactory.create(problem))));
  }
}

代码示例来源:origin: eclipse/eclipse.jdt.ls

private void checkSource(SubProgressMonitor monitor, RefactoringStatus result) throws CoreException {
  String newCuSource = fChange.getPreviewContent(new NullProgressMonitor());
  CompilationUnit newCUNode = new RefactoringASTParser(IASTSharedValues.SHARED_AST_LEVEL).parse(newCuSource, fCu, true, true, monitor);
  IProblem[] newProblems = RefactoringAnalyzeUtil.getIntroducedCompileProblems(newCUNode, fCuRewrite.getRoot());
  for (int i = 0; i < newProblems.length; i++) {
    IProblem problem = newProblems[i];
    if (problem.isError()) {
      result.addEntry(new RefactoringStatusEntry((problem.isError() ? RefactoringStatus.ERROR : RefactoringStatus.WARNING), problem.getMessage(), new JavaStringStatusContext(newCuSource, SourceRangeFactory.create(problem))));
    }
  }
}

代码示例来源:origin: org.eclipse.jdt/org.eclipse.jdt.ui

private void checkSource(SubProgressMonitor monitor, RefactoringStatus result) throws CoreException {
  String newCuSource= fChange.getPreviewContent(new NullProgressMonitor());
  CompilationUnit newCUNode= new RefactoringASTParser(IASTSharedValues.SHARED_AST_LEVEL).parse(newCuSource, fCu, true, true, monitor);
  IProblem[] newProblems= RefactoringAnalyzeUtil.getIntroducedCompileProblems(newCUNode, fCuRewrite.getRoot());
  for (int i= 0; i < newProblems.length; i++) {
    IProblem problem= newProblems[i];
    if (problem.isError())
      result.addEntry(new RefactoringStatusEntry((problem.isError() ? RefactoringStatus.ERROR : RefactoringStatus.WARNING), problem.getMessage(), new JavaStringStatusContext(newCuSource, SourceRangeFactory.create(problem))));
  }
}

代码示例来源:origin: org.eclipse.jdt/org.eclipse.jdt.ui

private static RefactoringStatus analyzeCompileErrors(String newCuSource, CompilationUnit newCUNode, CompilationUnit oldCUNode) {
    RefactoringStatus result= new RefactoringStatus();
    IProblem[] newProblems= RefactoringAnalyzeUtil.getIntroducedCompileProblems(newCUNode, oldCUNode);
    for (int i= 0; i < newProblems.length; i++) {
      IProblem problem= newProblems[i];
      if (problem.isError())
        result.addEntry(new RefactoringStatusEntry((problem.isError() ? RefactoringStatus.ERROR : RefactoringStatus.WARNING), problem.getMessage(), new JavaStringStatusContext(newCuSource,
            SourceRangeFactory.create(problem))));
    }
    return result;
  }
}

代码示例来源:origin: org.eclipse/org.eclipse.jdt.ui

private void checkNewSource(RefactoringStatus result) throws CoreException {
  String newCuSource= fChange.getPreviewContent(new NullProgressMonitor());
  CompilationUnit newCUNode= new RefactoringASTParser(AST.JLS3).parse(newCuSource, fCu, true, true, null);
  IProblem[] newProblems= RefactoringAnalyzeUtil.getIntroducedCompileProblems(newCUNode, fCompilationUnitNode);
  for (int i= 0; i < newProblems.length; i++) {
    IProblem problem= newProblems[i];
    if (problem.isError())
      result.addEntry(new RefactoringStatusEntry((problem.isError() ? RefactoringStatus.ERROR : RefactoringStatus.WARNING), problem.getMessage(), new JavaStringStatusContext(newCuSource, new SourceRange(problem))));
  }
}

代码示例来源:origin: eclipse/eclipse.jdt.ls

private static RefactoringStatus analyzeCompileErrors(String newCuSource, CompilationUnit newCUNode, CompilationUnit oldCUNode) {
    RefactoringStatus result= new RefactoringStatus();
    IProblem[] newProblems= RefactoringAnalyzeUtil.getIntroducedCompileProblems(newCUNode, oldCUNode);
    for (int i= 0; i < newProblems.length; i++) {
      IProblem problem= newProblems[i];
      if (problem.isError()) {
        result.addEntry(new RefactoringStatusEntry((problem.isError() ? RefactoringStatus.ERROR : RefactoringStatus.WARNING), problem.getMessage(), new JavaStringStatusContext(newCuSource,
            SourceRangeFactory.create(problem))));
      }
    }
    return result;
  }
}

代码示例来源:origin: org.eclipse.scout.sdk.deps/org.eclipse.jdt.ui

private static RefactoringStatus analyzeCompileErrors(String newCuSource, CompilationUnit newCUNode, CompilationUnit oldCUNode) {
    RefactoringStatus result= new RefactoringStatus();
    IProblem[] newProblems= RefactoringAnalyzeUtil.getIntroducedCompileProblems(newCUNode, oldCUNode);
    for (int i= 0; i < newProblems.length; i++) {
      IProblem problem= newProblems[i];
      if (problem.isError())
        result.addEntry(new RefactoringStatusEntry((problem.isError() ? RefactoringStatus.ERROR : RefactoringStatus.WARNING), problem.getMessage(), new JavaStringStatusContext(newCuSource,
            SourceRangeFactory.create(problem))));
    }
    return result;
  }
}

代码示例来源:origin: org.eclipse.jdt/org.eclipse.jdt.ui

private RefactoringStatus checkCompilationofDeclaringCu() throws CoreException {
  ICompilationUnit cu= getCu();
  TextChange change= fChangeManager.get(cu);
  String newCuSource= change.getPreviewContent(new NullProgressMonitor());
  CompilationUnit newCUNode= new RefactoringASTParser(IASTSharedValues.SHARED_AST_LEVEL).parse(newCuSource, cu, true, false, null);
  IProblem[] problems= RefactoringAnalyzeUtil.getIntroducedCompileProblems(newCUNode, fBaseCuRewrite.getRoot());
  RefactoringStatus result= new RefactoringStatus();
  for (int i= 0; i < problems.length; i++) {
    IProblem problem= problems[i];
    if (shouldReport(problem, newCUNode))
      result.addEntry(new RefactoringStatusEntry((problem.isError() ? RefactoringStatus.ERROR : RefactoringStatus.WARNING), problem.getMessage(), new JavaStringStatusContext(newCuSource, SourceRangeFactory.create(problem))));
  }
  return result;
}

代码示例来源:origin: org.eclipse/org.eclipse.jdt.ui

private static RefactoringStatus analyzeCompileErrors(String newCuSource, CompilationUnit newCUNode, CompilationUnit oldCUNode) {
    RefactoringStatus result= new RefactoringStatus();
    IProblem[] newProblems= RefactoringAnalyzeUtil.getIntroducedCompileProblems(newCUNode, oldCUNode);
    for (int i= 0; i < newProblems.length; i++) {
      IProblem problem= newProblems[i];
      if (problem.isError())
        result.addEntry(new RefactoringStatusEntry((problem.isError() ? RefactoringStatus.ERROR : RefactoringStatus.WARNING), problem.getMessage(), new JavaStringStatusContext(newCuSource, new SourceRange(problem))));
    }
    return result;
  }
}

相关文章