当前位置: 首页>>代码示例>>Java>>正文


Java HighlightDisplayLevel.find方法代码示例

本文整理汇总了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;
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:17,代码来源:InspectionProfileConvertor.java

示例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);
  }
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:22,代码来源:MultiScopeSeverityIcon.java

示例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;
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:11,代码来源:InspectionEP.java

示例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()));
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:10,代码来源:SeverityRegistrar.java

示例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();
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:31,代码来源:SingleInspectionProfilePanel.java

示例6: getHighlightDisplayLevel

import com.intellij.codeHighlighting.HighlightDisplayLevel; //导入方法依赖的package包/类
@NotNull
public static HighlightDisplayLevel getHighlightDisplayLevel() {
  return HighlightDisplayLevel.find(SpellCheckerSeveritiesProvider.TYPO);
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:5,代码来源:SpellCheckerManager.java


注:本文中的com.intellij.codeHighlighting.HighlightDisplayLevel.find方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。