本文整理匯總了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
);
}
示例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
);
}
示例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
);
}