From 0bc9a2f96fbc1e6ba1e1134c19bb98ed486bad70 Mon Sep 17 00:00:00 2001 From: Nadya Zabrodina Date: Thu, 27 Apr 2017 17:11:07 +0300 Subject: [PATCH] [vcs]: make showRemoveEmptyChangeListsProposal public and static * change LocalChangeList parameter collection to ChangeList; --- .../openapi/vcs/changes/ChangeListManagerImpl.java | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/platform/vcs-impl/src/com/intellij/openapi/vcs/changes/ChangeListManagerImpl.java b/platform/vcs-impl/src/com/intellij/openapi/vcs/changes/ChangeListManagerImpl.java index 316aaa655917..df6677444a42 100644 --- a/platform/vcs-impl/src/com/intellij/openapi/vcs/changes/ChangeListManagerImpl.java +++ b/platform/vcs-impl/src/com/intellij/openapi/vcs/changes/ChangeListManagerImpl.java @@ -194,7 +194,7 @@ public class ChangeListManagerImpl extends ChangeListManagerEx implements Projec @Override public boolean askIfShouldRemoveChangeLists(@NotNull List toAsk) { return myConfig.REMOVE_EMPTY_INACTIVE_CHANGELISTS != VcsShowConfirmationOption.Value.SHOW_CONFIRMATION || - showRemoveEmptyChangeListsProposal(myConfig, toAsk); + showRemoveEmptyChangeListsProposal(myProject, myConfig, toAsk); } }); } @@ -204,7 +204,9 @@ public class ChangeListManagerImpl extends ChangeListManagerEx implements Projec * * @return true if the changelists have to be deleted, false if not. */ - private boolean showRemoveEmptyChangeListsProposal(@NotNull final VcsConfiguration config, @NotNull Collection lists) { + public static boolean showRemoveEmptyChangeListsProposal(@NotNull Project project, + @NotNull final VcsConfiguration config, + @NotNull Collection lists) { if (lists.isEmpty()) { return false; } @@ -216,10 +218,10 @@ public class ChangeListManagerImpl extends ChangeListManagerEx implements Projec } else { question = String.format("Empty changelists
%s are no longer active.
Do you want to remove them?", - StringUtil.join(lists, (Function)list -> StringUtil.first(list.getName(), 30, true), "
")); + StringUtil.join(lists, (Function)list -> StringUtil.first(list.getName(), 30, true), "
")); } - VcsConfirmationDialog dialog = new VcsConfirmationDialog(myProject, "Remove Empty Changelist", "Remove", "Cancel", new VcsShowConfirmationOption() { + VcsConfirmationDialog dialog = new VcsConfirmationDialog(project, "Remove Empty Changelist", "Remove", "Cancel", new VcsShowConfirmationOption() { @Override public Value getValue() { return config.REMOVE_EMPTY_INACTIVE_CHANGELISTS;