當前位置: 首頁>>代碼示例>>Java>>正文


Java GlobalInspectionContextUtil類代碼示例

本文整理匯總了Java中com.intellij.codeInspection.ex.GlobalInspectionContextUtil的典型用法代碼示例。如果您正苦於以下問題:Java GlobalInspectionContextUtil類的具體用法?Java GlobalInspectionContextUtil怎麽用?Java GlobalInspectionContextUtil使用的例子?那麽, 這裏精選的類代碼示例或許可以為您提供幫助。


GlobalInspectionContextUtil類屬於com.intellij.codeInspection.ex包,在下文中一共展示了GlobalInspectionContextUtil類的3個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。

示例1: createProblem

import com.intellij.codeInspection.ex.GlobalInspectionContextUtil; //導入依賴的package包/類
public static void createProblem(@NotNull PsiElement elt,
                                 @NotNull HighlightInfo info,
                                 TextRange range,
                                 @Nullable ProblemGroup problemGroup,
                                 @NotNull InspectionManager manager,
                                 @NotNull ProblemDescriptionsProcessor problemDescriptionsProcessor,
                                 @NotNull GlobalInspectionContext globalContext) {
  List<LocalQuickFix> fixes = new ArrayList<LocalQuickFix>();
  if (info.quickFixActionRanges != null) {
    for (Pair<HighlightInfo.IntentionActionDescriptor, TextRange> actionRange : info.quickFixActionRanges) {
      final IntentionAction action = actionRange.getFirst().getAction();
      if (action instanceof LocalQuickFix) {
        fixes.add((LocalQuickFix)action);
      }
    }
  }
  ProblemDescriptor descriptor = manager.createProblemDescriptor(elt, range, createInspectionMessage(StringUtil.notNullize(info.getDescription())),
                                                                 HighlightInfo.convertType(info.type), false,
                                                                 fixes.isEmpty() ? null : fixes.toArray(new LocalQuickFix[fixes.size()]));
  descriptor.setProblemGroup(problemGroup);
  problemDescriptionsProcessor.addProblemElement(
    GlobalInspectionContextUtil.retrieveRefElement(elt, globalContext),
    descriptor
  );
}
 
開發者ID:jskierbi,項目名稱:intellij-ce-playground,代碼行數:26,代碼來源:GlobalInspectionUtil.java

示例2: createProblem

import com.intellij.codeInspection.ex.GlobalInspectionContextUtil; //導入依賴的package包/類
public static void createProblem(PsiElement elt,
                                 @NotNull HighlightInfo info,
                                 TextRange range,
                                 @Nullable ProblemGroup problemGroup,
                                 @NotNull InspectionManager manager,
                                 @NotNull ProblemDescriptionsProcessor problemDescriptionsProcessor,
                                 @NotNull GlobalInspectionContext globalContext) {
  List<LocalQuickFix> fixes = new ArrayList<LocalQuickFix>();
  if (info.quickFixActionRanges != null) {
    for (Pair<HighlightInfo.IntentionActionDescriptor, TextRange> actionRange : info.quickFixActionRanges) {
      final IntentionAction action = actionRange.getFirst().getAction();
      if (action instanceof LocalQuickFix) {
        fixes.add((LocalQuickFix)action);
      }
    }
  }
  ProblemDescriptor descriptor = manager.createProblemDescriptor(elt, range, createInspectionMessage(StringUtil.notNullize(info.getDescription())),
                                                                 HighlightInfo.convertType(info.type), false,
                                                                 fixes.isEmpty() ? null : fixes.toArray(new LocalQuickFix[fixes.size()]));
  descriptor.setProblemGroup(problemGroup);
  problemDescriptionsProcessor.addProblemElement(
    GlobalInspectionContextUtil.retrieveRefElement(elt, globalContext),
    descriptor
  );
}
 
開發者ID:lshain-android-source,項目名稱:tools-idea,代碼行數:26,代碼來源:GlobalInspectionUtil.java

示例3: createProblem

import com.intellij.codeInspection.ex.GlobalInspectionContextUtil; //導入依賴的package包/類
public static void createProblem(@Nonnull PsiElement elt,
                                 @Nonnull HighlightInfo info,
                                 TextRange range,
                                 @Nullable ProblemGroup problemGroup,
                                 @Nonnull InspectionManager manager,
                                 @Nonnull ProblemDescriptionsProcessor problemDescriptionsProcessor,
                                 @Nonnull GlobalInspectionContext globalContext) {
  List<LocalQuickFix> fixes = new ArrayList<LocalQuickFix>();
  if (info.quickFixActionRanges != null) {
    for (Pair<HighlightInfo.IntentionActionDescriptor, TextRange> actionRange : info.quickFixActionRanges) {
      final IntentionAction action = actionRange.getFirst().getAction();
      if (action instanceof LocalQuickFix) {
        fixes.add((LocalQuickFix)action);
      }
    }
  }
  ProblemDescriptor descriptor = manager.createProblemDescriptor(elt, range, createInspectionMessage(StringUtil.notNullize(info.getDescription())),
                                                                 HighlightInfo.convertType(info.type), false,
                                                                 fixes.isEmpty() ? null : fixes.toArray(new LocalQuickFix[fixes.size()]));
  descriptor.setProblemGroup(problemGroup);
  problemDescriptionsProcessor.addProblemElement(
          GlobalInspectionContextUtil.retrieveRefElement(elt, globalContext),
          descriptor
  );
}
 
開發者ID:consulo,項目名稱:consulo,代碼行數:26,代碼來源:GlobalInspectionUtil.java


注:本文中的com.intellij.codeInspection.ex.GlobalInspectionContextUtil類示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。