Java Code Examples for com.intellij.codeInspection.ProblemHighlightType#LIKE_UNKNOWN_SYMBOL

The following examples show how to use com.intellij.codeInspection.ProblemHighlightType#LIKE_UNKNOWN_SYMBOL . You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: Annotation.java    From consulo with Apache License 2.0 6 votes vote down vote up
/**
 * Returns the text attribute key used for highlighting the annotation. If not specified
 * explicitly, the key is determined automatically based on the problem highlight type and
 * the annotation severity.
 *
 * @return the text attribute key used for highlighting
 */
@Nonnull
public TextAttributesKey getTextAttributes() {
  if (myEnforcedAttributesKey != null) return myEnforcedAttributesKey;

  if (myHighlightType == ProblemHighlightType.GENERIC_ERROR_OR_WARNING) {
    if (mySeverity == HighlightSeverity.ERROR) return CodeInsightColors.ERRORS_ATTRIBUTES;
    if (mySeverity == HighlightSeverity.WARNING) return CodeInsightColors.WARNINGS_ATTRIBUTES;
    if (mySeverity == HighlightSeverity.WEAK_WARNING) return CodeInsightColors.WEAK_WARNING_ATTRIBUTES;
  }

  if (myHighlightType == ProblemHighlightType.GENERIC_ERROR) {
    return CodeInsightColors.ERRORS_ATTRIBUTES;
  }

  if (myHighlightType == ProblemHighlightType.LIKE_DEPRECATED) {
    return CodeInsightColors.DEPRECATED_ATTRIBUTES;
  }
  if (myHighlightType == ProblemHighlightType.LIKE_UNUSED_SYMBOL) {
    return CodeInsightColors.NOT_USED_ELEMENT_ATTRIBUTES;
  }
  if (myHighlightType == ProblemHighlightType.LIKE_UNKNOWN_SYMBOL || myHighlightType == ProblemHighlightType.ERROR) {
    return CodeInsightColors.WRONG_REFERENCES_ATTRIBUTES;
  }
  return HighlighterColors.NO_HIGHLIGHTING;
}