Пример #1
0
 private void reset(SeverityBasedTextAttributes info) {
   final MyTextAttributesDescription description =
       new MyTextAttributesDescription(
           info.getType().toString(),
           null,
           info.getAttributes(),
           info.getType().getAttributesKey());
   @NonNls Element textAttributes = new Element("temp");
   try {
     info.getAttributes().writeExternal(textAttributes);
     description.getTextAttributes().readExternal(textAttributes);
   } catch (Exception e) {
     LOG.error(e);
   }
   myOptionsPanel.reset(description);
 }
Пример #2
0
 public void registerSeverity(@NotNull SeverityBasedTextAttributes info, Color renderColor) {
   final HighlightSeverity severity = info.getType().getSeverity(null);
   myMap.put(severity.getName(), info);
   if (renderColor != null) {
     myRendererColors.put(severity.getName(), renderColor);
   }
   myOrderMap = null;
   HighlightDisplayLevel.registerSeverity(
       severity, getHighlightInfoTypeBySeverity(severity).getAttributesKey());
   severitiesChanged();
 }
Пример #3
0
  @NotNull
  public HighlightInfoType.HighlightInfoTypeImpl getHighlightInfoTypeBySeverity(
      @NotNull HighlightSeverity severity) {
    HighlightInfoType infoType = STANDARD_SEVERITIES.get(severity.getName());
    if (infoType != null) {
      return (HighlightInfoType.HighlightInfoTypeImpl) infoType;
    }

    if (severity == HighlightSeverity.INFORMATION) {
      return (HighlightInfoType.HighlightInfoTypeImpl) HighlightInfoType.INFORMATION;
    }

    final SeverityBasedTextAttributes type = getAttributesBySeverity(severity);
    return (HighlightInfoType.HighlightInfoTypeImpl)
        (type == null ? HighlightInfoType.WARNING : type.getType());
  }
Пример #4
0
 @Nullable
 public HighlightInfoType getSelectedType() {
   final SeverityBasedTextAttributes selection =
       (SeverityBasedTextAttributes) myOptionsList.getSelectedValue();
   return selection != null ? selection.getType() : null;
 }