mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-09-27 10:03:11 +07:00
[vcs]: make showRemoveEmptyChangeListsProposal public and static
* change LocalChangeList parameter collection to ChangeList;
This commit is contained in:
@@ -194,7 +194,7 @@ public class ChangeListManagerImpl extends ChangeListManagerEx implements Projec
|
||||
@Override
|
||||
public boolean askIfShouldRemoveChangeLists(@NotNull List<? extends LocalChangeList> 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<? extends LocalChangeList> lists) {
|
||||
public static boolean showRemoveEmptyChangeListsProposal(@NotNull Project project,
|
||||
@NotNull final VcsConfiguration config,
|
||||
@NotNull Collection<? extends ChangeList> lists) {
|
||||
if (lists.isEmpty()) {
|
||||
return false;
|
||||
}
|
||||
@@ -216,10 +218,10 @@ public class ChangeListManagerImpl extends ChangeListManagerEx implements Projec
|
||||
}
|
||||
else {
|
||||
question = String.format("<html>Empty changelists<br/>%s are no longer active.<br>Do you want to remove them?</html>",
|
||||
StringUtil.join(lists, (Function<LocalChangeList, String>)list -> StringUtil.first(list.getName(), 30, true), "<br/>"));
|
||||
StringUtil.join(lists, (Function<ChangeList, String>)list -> StringUtil.first(list.getName(), 30, true), "<br/>"));
|
||||
}
|
||||
|
||||
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;
|
||||
|
||||
Reference in New Issue
Block a user