@Override
  protected @Nullable String getPresentableName(@NotNull PsiElement element) {
    if (element instanceof PsiEnumConstantInitializer initializer) {
      return QuickDocHighlightingHelper.getStyledFragment(
        initializer.getEnumConstant().getName(),
        JavaDocHighlightingManagerImpl.getInstance().getEnumNameAttributes()
      );
    }
    if (element instanceof PsiAnonymousClass) {
      return QuickDocHighlightingHelper.getStyledFragment(
        JavaBundle.message("tooltip.anonymous"),
        JavaDocHighlightingManagerImpl.getInstance().getAnonymousClassNameAttributes());
    }
    if (element instanceof PsiNamedElement named) {
      TextAttributes attributes = null;
      if (element instanceof PsiClass cls) {
        attributes = JavaDocHighlightingManagerImpl.getInstance().getClassDeclarationAttributes(cls);
      }
      else if (element instanceof PsiMethod method) {
        attributes = JavaDocHighlightingManagerImpl.getInstance().getMethodDeclarationAttributes(method);
      }
      else if (element instanceof PsiParameter) {
        attributes = JavaDocHighlightingManagerImpl.getInstance().getParameterAttributes();
      }
      else if (element instanceof PsiField field) {
        attributes = JavaDocHighlightingManagerImpl.getInstance().getFieldDeclarationAttributes(field);
      }
      String name = named.getName();
      if (attributes != null && name != null) {
        return QuickDocHighlightingHelper.getStyledFragment(name, attributes);
      }
      else {
        return name;
      }
    }
    return null;
  }
@Override
  protected @Nullable String getPresentableName(@NotNull PsiElement element)