package com.intellij.vcs.log.ui;

import com.intellij.openapi.vcs.FilePath;
import com.intellij.openapi.vfs.VirtualFile;
import com.intellij.vcsUtil.VcsUtil;
import org.jetbrains.annotations.NotNull;

import java.awt.*;
import java.util.Collection;

/**
 * Managers colors used for paths in the vcs log.
 *
 * @author Kirill Likhodedov
 */
public interface VcsLogColorManager {

  /**
   * Returns the color assigned to the given repository root.
   */
  @NotNull
  default Color getRootColor(@NotNull VirtualFile root) {
    return getPathColor(VcsUtil.getFilePath(root));
  }

  /**
   * Returns the color assigned to the given file path.
   */
  @NotNull
  Color getPathColor(@NotNull FilePath path);

  /**
   * Tells if there are several paths currently shown in the log.
   */
  default boolean hasMultiplePaths() {
    return getPaths().size() > 1;
  }

  /**
   * Returns paths managed by this manager.
   */
  @NotNull
  Collection<FilePath> getPaths();

  /**
   * Returns long name for this file path (to be shown in the tooltip, etc.).
   */
  @NotNull
  default String getLongName(@NotNull FilePath path) {
    return path.getPresentableUrl();
  }
}

@@ -27,16 +27,58 @@
 og.ui;%0A%0A
+import com.intellij.openapi.util.NlsSafe;%0A
 import c
@@ -1092,32 +1092,43 @@
   */%0A  @NotNull%0A
+  @NlsSafe%0A
   default String

add NlsSafe annotation for VcsLogColorManager