TextAttributes (@NotNull PsiModifierListOwner listOwner, TextAttributes basedAttributes, @NotNull TextAttributesScheme colorsScheme) { TextAttributesKey attributesKey = null; if (listOwner.hasModifierProperty(PsiModifier.PUBLIC)) { attributesKey = JavaHighlightingColors.PUBLIC_REFERENCE_ATTRIBUTES; } else if (listOwner.hasModifierProperty(PsiModifier.PROTECTED)) { attributesKey = JavaHighlightingColors.PROTECTED_REFERENCE_ATTRIBUTES; } else if (listOwner.hasModifierProperty(PsiModifier.PACKAGE_LOCAL)) { attributesKey = JavaHighlightingColors.PACKAGE_PRIVATE_REFERENCE_ATTRIBUTES; } else if (listOwner.hasModifierProperty(PsiModifier.PRIVATE)) { attributesKey = JavaHighlightingColors.PRIVATE_REFERENCE_ATTRIBUTES; } if (attributesKey != null) { TextAttributes visibilityAttributes = colorsScheme.getAttributes(attributesKey); if (visibilityAttributes != null && !visibilityAttributes.isEmpty()) return TextAttributes.merge(basedAttributes, visibilityAttributes); } return basedAttributes; }