From 80f5a08a6512c6ad17b8543fee35c4caf1d3f215 Mon Sep 17 00:00:00 2001 From: Nadya Zabrodina Date: Fri, 21 Apr 2017 14:10:54 +0300 Subject: [PATCH] [vcs]: (IDEA-171643) BranchPopup Widget: remove "current" root marker * remove unused parameters and method; --- .../com/intellij/dvcs/branch/DvcsBranchPopup.java | 4 ---- .../src/com/intellij/dvcs/ui/RootAction.java | 14 +------------- .../src/git4idea/ui/branch/GitBranchPopup.java | 3 +-- .../src/org/zmlx/hg4idea/branch/HgBranchPopup.java | 3 +-- 4 files changed, 3 insertions(+), 21 deletions(-) diff --git a/platform/dvcs-impl/src/com/intellij/dvcs/branch/DvcsBranchPopup.java b/platform/dvcs-impl/src/com/intellij/dvcs/branch/DvcsBranchPopup.java index 556225843eac..1f3a87c7917f 100644 --- a/platform/dvcs-impl/src/com/intellij/dvcs/branch/DvcsBranchPopup.java +++ b/platform/dvcs-impl/src/com/intellij/dvcs/branch/DvcsBranchPopup.java @@ -152,10 +152,6 @@ public abstract class DvcsBranchPopup { @NotNull protected abstract DefaultActionGroup createRepositoriesActions(); - protected boolean highlightCurrentRepo() { - return !userWantsSyncControl() || myMultiRootBranchConfig.diverged(); - } - protected abstract void fillPopupWithCurrentRepositoryActions(@NotNull DefaultActionGroup popupGroup, @Nullable DefaultActionGroup actions); diff --git a/platform/dvcs-impl/src/com/intellij/dvcs/ui/RootAction.java b/platform/dvcs-impl/src/com/intellij/dvcs/ui/RootAction.java index 86fa16fe6baa..7e9f5a22778f 100644 --- a/platform/dvcs-impl/src/com/intellij/dvcs/ui/RootAction.java +++ b/platform/dvcs-impl/src/com/intellij/dvcs/ui/RootAction.java @@ -20,16 +20,12 @@ import com.intellij.dvcs.repo.Repository; import com.intellij.openapi.actionSystem.ActionGroup; import com.intellij.openapi.actionSystem.AnAction; import com.intellij.openapi.actionSystem.AnActionEvent; -import com.intellij.util.PlatformIcons; import org.jetbrains.annotations.NotNull; import org.jetbrains.annotations.Nullable; /** * The element of the branch popup which allows to show branches of the selected repository. * It is available only in projects with multiple roots. - * - * @author Kirill Likhodedov - * @author Nadya Zabrodina */ public class RootAction extends ActionGroup implements PopupElementWithAdditionalInfo { @@ -37,19 +33,11 @@ public class RootAction extends ActionGroup implements Pop @NotNull private final ActionGroup myGroup; @NotNull private final String myBranchText; - /** - * @param currentRepository Pass null in the case of common repositories - none repository will be highlighted then. - * @param actionsGroup - * @param branchText - */ - public RootAction(@NotNull T repository, @Nullable T currentRepository, @NotNull ActionGroup actionsGroup, @NotNull String branchText) { + public RootAction(@NotNull T repository, @NotNull ActionGroup actionsGroup, @NotNull String branchText) { super("", true); myRepository = repository; myGroup = actionsGroup; myBranchText = branchText; - if (repository.equals(currentRepository)) { - getTemplatePresentation().setIcon(PlatformIcons.CHECK_ICON); - } getTemplatePresentation().setText(DvcsUtil.getShortRepositoryName(repository), false); } diff --git a/plugins/git4idea/src/git4idea/ui/branch/GitBranchPopup.java b/plugins/git4idea/src/git4idea/ui/branch/GitBranchPopup.java index 728eafb11235..30f02e80538d 100644 --- a/plugins/git4idea/src/git4idea/ui/branch/GitBranchPopup.java +++ b/plugins/git4idea/src/git4idea/ui/branch/GitBranchPopup.java @@ -153,8 +153,7 @@ class GitBranchPopup extends DvcsBranchPopup { DefaultActionGroup popupGroup = new DefaultActionGroup(null, false); popupGroup.addSeparator("Repositories"); List rootActions = DvcsUtil.sortRepositories(myRepositoryManager.getRepositories()).stream() - .map(repo -> new RootAction<>(repo, highlightCurrentRepo() ? myCurrentRepository : null, - new GitBranchPopupActions(repo.getProject(), repo).createActions(), + .map(repo -> new RootAction<>(repo, new GitBranchPopupActions(repo.getProject(), repo).createActions(), GitBranchUtil.getDisplayableBranchText(repo))).collect(toList()); wrapWithMoreActionIfNeeded(myProject, popupGroup, rootActions, rootActions.size() > MAX_NUM ? DEFAULT_NUM : MAX_NUM, SHOW_ALL_REPOSITORIES); diff --git a/plugins/hg4idea/src/org/zmlx/hg4idea/branch/HgBranchPopup.java b/plugins/hg4idea/src/org/zmlx/hg4idea/branch/HgBranchPopup.java index f6f1f6ddf933..67979119747b 100644 --- a/plugins/hg4idea/src/org/zmlx/hg4idea/branch/HgBranchPopup.java +++ b/plugins/hg4idea/src/org/zmlx/hg4idea/branch/HgBranchPopup.java @@ -125,8 +125,7 @@ public class HgBranchPopup extends DvcsBranchPopup { DefaultActionGroup popupGroup = new DefaultActionGroup(null, false); popupGroup.addSeparator("Repositories"); List rootActions = DvcsUtil.sortRepositories(myRepositoryManager.getRepositories()).stream() - .map(repo -> new RootAction<>(repo, highlightCurrentRepo() ? myCurrentRepository : null, - new HgBranchPopupActions(repo.getProject(), repo).createActions(), + .map(repo -> new RootAction<>(repo, new HgBranchPopupActions(repo.getProject(), repo).createActions(), HgUtil.getDisplayableBranchOrBookmarkText(repo))).collect(toList()); wrapWithMoreActionIfNeeded(myProject, popupGroup, rootActions, rootActions.size() > MAX_NUM ? DEFAULT_NUM : MAX_NUM, SHOW_ALL_REPOSITORIES);