本文整理汇总了Java中com.intellij.codeHighlighting.HighlightDisplayLevel.DO_NOT_SHOW属性的典型用法代码示例。如果您正苦于以下问题:Java HighlightDisplayLevel.DO_NOT_SHOW属性的具体用法?Java HighlightDisplayLevel.DO_NOT_SHOW怎么用?Java HighlightDisplayLevel.DO_NOT_SHOW使用的例子?那么, 这里精选的属性代码示例或许可以为您提供帮助。您也可以进一步了解该属性所在类com.intellij.codeHighlighting.HighlightDisplayLevel
的用法示例。
在下文中一共展示了HighlightDisplayLevel.DO_NOT_SHOW属性的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: runInspectionTool
private static Map<ProblemDescriptor, HighlightDisplayLevel> runInspectionTool(final PsiFile file,
final LocalInspectionTool inspectionTool,
final HighlightDisplayLevel level) {
Map<ProblemDescriptor, HighlightDisplayLevel> problemsMap = new LinkedHashMap<ProblemDescriptor, HighlightDisplayLevel>();
for (ProblemDescriptor descriptor : runInspectionOnFile(file, inspectionTool)) {
final ProblemHighlightType highlightType = descriptor.getHighlightType();
final HighlightDisplayLevel highlightDisplayLevel;
if (highlightType == ProblemHighlightType.WEAK_WARNING) {
highlightDisplayLevel = HighlightDisplayLevel.WEAK_WARNING;
}
else if (highlightType == ProblemHighlightType.INFORMATION) {
highlightDisplayLevel = HighlightDisplayLevel.DO_NOT_SHOW;
}
else {
highlightDisplayLevel = level;
}
problemsMap.put(descriptor, highlightDisplayLevel);
}
return problemsMap;
}
示例2: fillErrorLevels
protected void fillErrorLevels(final ModifiableModel profile) {
InspectionToolWrapper[] toolWrappers = profile.getInspectionTools(null);
LOG.assertTrue(toolWrappers != null, "Profile was not correctly init");
//fill error levels
for (final String shortName : myDisplayLevelMap.keySet()) {
//key <-> short name
HighlightDisplayLevel level = myDisplayLevelMap.get(shortName);
HighlightDisplayKey key = HighlightDisplayKey.find(shortName);
if (key == null) continue;
//set up tools for default profile
if (level != HighlightDisplayLevel.DO_NOT_SHOW) {
profile.enableTool(shortName, null, null);
}
if (level == null || level == HighlightDisplayLevel.DO_NOT_SHOW) {
level = HighlightDisplayLevel.WARNING;
}
profile.setErrorLevel(key, level, null);
}
}
示例3: getHighlightDisplayLevel
private static HighlightDisplayLevel getHighlightDisplayLevel(final LocalInspectionTool inspectionTool,
final InspectionProfile inspectionProfile, PsiElement file) {
final HighlightDisplayKey key = HighlightDisplayKey.find(inspectionTool.getShortName());
return inspectionProfile.isToolEnabled(key, file) ? inspectionProfile.getErrorLevel(key, file) : HighlightDisplayLevel.DO_NOT_SHOW;
}
示例4: addTool
public void addTool(@Nullable Project project, @NotNull InspectionToolWrapper toolWrapper, @NotNull Map<String, List<String>> dependencies) {
final String shortName = toolWrapper.getShortName();
HighlightDisplayKey key = HighlightDisplayKey.find(shortName);
if (key == null) {
final InspectionEP extension = toolWrapper.getExtension();
Computable<String> computable = extension == null ? new Computable.PredefinedValueComputable<String>(toolWrapper.getDisplayName()) : new Computable<String>() {
@Override
public String compute() {
return extension.getDisplayName();
}
};
if (toolWrapper instanceof LocalInspectionToolWrapper) {
key = HighlightDisplayKey.register(shortName, computable, toolWrapper.getID(),
((LocalInspectionToolWrapper)toolWrapper).getAlternativeID());
}
else {
key = HighlightDisplayKey.register(shortName, computable);
}
}
LOG.assertTrue(key != null, shortName + " ; number of initialized tools: " + myTools.size());
HighlightDisplayLevel baseLevel = myBaseProfile != null && myBaseProfile.getTools(shortName, project) != null
? myBaseProfile.getErrorLevel(key, project)
: HighlightDisplayLevel.DO_NOT_SHOW;
HighlightDisplayLevel defaultLevel = toolWrapper.getDefaultLevel();
HighlightDisplayLevel level = baseLevel.getSeverity().compareTo(defaultLevel.getSeverity()) > 0 ? baseLevel : defaultLevel;
//HighlightDisplayLevel level = myBaseProfile != null && myBaseProfile.getTools(shortName, project) != null ? myBaseProfile.getErrorLevel(key, project) : toolWrapper.getDefaultLevel();
boolean enabled = myBaseProfile != null ? myBaseProfile.isToolEnabled(key) : toolWrapper.isEnabledByDefault();
final ToolsImpl toolsList = new ToolsImpl(toolWrapper, level, !myLockedProfile && enabled, enabled);
final Element element = myUninstalledInspectionsSettings.remove(shortName);
try {
if (element != null) {
toolsList.readExternal(element, this, dependencies);
}
else if (!myUninstalledInspectionsSettings.containsKey(InspectionElementsMerger.getMergedMarkerName(shortName))) {
final InspectionElementsMerger merger = getMergers().get(shortName);
if (merger != null) {
final Element merged = merger.merge(myUninstalledInspectionsSettings);
if (merged != null) {
toolsList.readExternal(merged, this, dependencies);
}
}
}
}
catch (InvalidDataException e) {
LOG.error("Can't read settings for " + toolWrapper, e);
}
myTools.put(shortName, toolsList);
}