// Copyright 2000-2021 JetBrains s.r.o. Use of this source code is governed by the Apache 2.0 license that can be found in the LICENSE file.
package com.intellij.navigation;

import com.intellij.openapi.editor.markup.TextAttributes;
import org.jetbrains.annotations.ApiStatus.Experimental;
import org.jetbrains.annotations.NotNull;
import org.jetbrains.annotations.Nullable;

import javax.swing.*;

/**
 * Represents presentation in target popup as follows:<br/>
 * <code>| $icon $presentable_text (in $location_text) spacer $right_text $right_icon |</code><br/>
 * Elements before spacer are aligned to the left, right text and right icon are aligned to the right.
 */
@Experimental
public interface TargetPopupPresentation {

  default @Nullable Icon getIcon() {
    return null;
  }

  @NotNull String getPresentableText();

  /**
   * Note that returned instance's {@link TextAttributes#getBackgroundColor()} is used for the whole item background.
   *
   * @return attributes to highlight {@link #getPresentableText()}
   */
  default @Nullable TextAttributes getPresentableAttributes() {
    return null;
  }

  default @Nullable String getLocationText() {
    return null;
  }

  /**
   * @return attributes to highlight {@link #getLocationText()}
   */
  default @Nullable TextAttributes getLocationAttributes() {
    return null;
  }

  default @Nullable String getRightText() {
    return null;
  }

  default @Nullable Icon getRightIcon() {
    return null;
  }
}

@@ -283,16 +283,54 @@
 mental;%0A
+import org.jetbrains.annotations.Nls;%0A
 import o
@@ -363,16 +363,16 @@
 otNull;%0A
-
 import o
@@ -820,16 +820,21 @@
 %0A  %7D%0A%0A  
+@Nls 
 @NotNull
@@ -1154,32 +1154,37 @@
 %0A  %7D%0A%0A  default 
+@Nls 
 @Nullable String
@@ -1377,32 +1377,32 @@
 turn null;%0A  %7D%0A%0A
-
   default @Nulla
@@ -1387,32 +1387,37 @@
 %0A  %7D%0A%0A  default 
+@Nls 
 @Nullable String

add @Nls annotations to TargetPopupPresentation