本文整理汇总了Java中com.intellij.codeHighlighting.HighlightDisplayLevel.find方法的典型用法代码示例。如果您正苦于以下问题:Java HighlightDisplayLevel.find方法的具体用法?Java HighlightDisplayLevel.find怎么用?Java HighlightDisplayLevel.find使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类com.intellij.codeHighlighting.HighlightDisplayLevel
的用法示例。
在下文中一共展示了HighlightDisplayLevel.find方法的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: processElement
import com.intellij.codeHighlighting.HighlightDisplayLevel; //导入方法依赖的package包/类
protected boolean processElement(final Element option, final String name) {
if (name.equals(DISPLAY_LEVEL_MAP_OPTION)) {
final Element levelMap = option.getChild(VALUE_ATT);
for (final Object o : levelMap.getChildren()) {
Element e = (Element)o;
String key = e.getName();
String levelName = e.getAttributeValue(LEVEL_ATT);
HighlightSeverity severity = myManager.getSeverityRegistrar().getSeverity(levelName);
HighlightDisplayLevel level = severity == null ? null : HighlightDisplayLevel.find(severity);
if (level == null) continue;
myDisplayLevelMap.put(key, level);
}
return true;
}
return false;
}
示例2: MultiScopeSeverityIcon
import com.intellij.codeHighlighting.HighlightDisplayLevel; //导入方法依赖的package包/类
public MultiScopeSeverityIcon(final Map<String, HighlightSeverity> scopeToAverageSeverityMap,
final String defaultScopeName,
final InspectionProfileImpl inspectionProfile) {
myDefaultScopeName = defaultScopeName;
final List<String> sortedScopeNames = new ArrayList<String>(scopeToAverageSeverityMap.keySet());
myScopeToAverageSeverityMap = new LinkedHashMap<String, HighlightDisplayLevel>();
Collections.sort(sortedScopeNames, new ScopeOrderComparator(inspectionProfile));
sortedScopeNames.remove(defaultScopeName);
sortedScopeNames.add(defaultScopeName);
for (final String scopeName : sortedScopeNames) {
final HighlightSeverity severity = scopeToAverageSeverityMap.get(scopeName);
if (severity == null) {
continue;
}
final HighlightDisplayLevel level = HighlightDisplayLevel.find(severity);
if (level == null) {
continue;
}
myScopeToAverageSeverityMap.put(scopeName, level);
}
}
示例3: getDefaultLevel
import com.intellij.codeHighlighting.HighlightDisplayLevel; //导入方法依赖的package包/类
@NotNull
public HighlightDisplayLevel getDefaultLevel() {
if (level == null) return HighlightDisplayLevel.WARNING;
HighlightDisplayLevel displayLevel = HighlightDisplayLevel.find(level);
if (displayLevel == null) {
LOG.error("Can't find highlight display level: " + level);
return HighlightDisplayLevel.WARNING;
}
return displayLevel;
}
示例4: getRendererIconByIndex
import com.intellij.codeHighlighting.HighlightDisplayLevel; //导入方法依赖的package包/类
public Icon getRendererIconByIndex(int i) {
final HighlightSeverity severity = getSeverityByIndex(i);
HighlightDisplayLevel level = HighlightDisplayLevel.find(severity);
if (level != null) {
return level.getIcon();
}
return HighlightDisplayLevel.createIconByMask(myRendererColors.get(severity.getName()));
}
示例5: compoundPopup
import com.intellij.codeHighlighting.HighlightDisplayLevel; //导入方法依赖的package包/类
private JPopupMenu compoundPopup() {
final DefaultActionGroup group = new DefaultActionGroup();
final SeverityRegistrar severityRegistrar = ((SeverityProvider)mySelectedProfile.getProfileManager()).getOwnSeverityRegistrar();
TreeSet<HighlightSeverity> severities = new TreeSet<HighlightSeverity>(severityRegistrar);
severities.add(HighlightSeverity.ERROR);
severities.add(HighlightSeverity.WARNING);
severities.add(HighlightSeverity.WEAK_WARNING);
final Collection<SeverityRegistrar.SeverityBasedTextAttributes> infoTypes =
SeverityUtil.getRegisteredHighlightingInfoTypes(severityRegistrar);
for (SeverityRegistrar.SeverityBasedTextAttributes info : infoTypes) {
severities.add(info.getSeverity());
}
for (HighlightSeverity severity : severities) {
final HighlightDisplayLevel level = HighlightDisplayLevel.find(severity);
group.add(new AnAction(renderSeverity(severity), renderSeverity(severity), level.getIcon()) {
@Override
public void actionPerformed(@NotNull AnActionEvent e) {
setNewHighlightingLevel(level);
}
@Override
public boolean isDumbAware() {
return true;
}
});
}
group.add(Separator.getInstance());
ActionPopupMenu menu = ActionManager.getInstance().createActionPopupMenu(ActionPlaces.UNKNOWN, group);
return menu.getComponent();
}
示例6: getHighlightDisplayLevel
import com.intellij.codeHighlighting.HighlightDisplayLevel; //导入方法依赖的package包/类
@NotNull
public static HighlightDisplayLevel getHighlightDisplayLevel() {
return HighlightDisplayLevel.find(SpellCheckerSeveritiesProvider.TYPO);
}