use of com.virtuslab.gitmachete.frontend.actions.dialogs.DeleteBranchOnSlideOutSuggestionDialog in project git-machete-intellij-plugin by VirtusLab.
the class BaseSlideOutBranchAction method suggestBranchDeletion.
@UIEffect
private void suggestBranchDeletion(AnActionEvent anActionEvent, String branchName, GitRepository gitRepository, Project project) {
val slideOutOptions = new DeleteBranchOnSlideOutSuggestionDialog(project).showAndGetSlideOutOptions();
new Task.Backgroundable(project, "Deleting branch if required...") {
@Override
@UIThreadUnsafe
public void run(ProgressIndicator indicator) {
if (slideOutOptions != null) {
handleBranchDeletionDecision(project, branchName, gitRepository, anActionEvent, slideOutOptions.shouldDelete());
if (slideOutOptions.shouldRemember()) {
val value = String.valueOf(slideOutOptions.shouldDelete());
setDeleteLocalBranchOnSlideOutGitConfigValue(project, gitRepository.getRoot(), value);
}
} else {
val title = getString("action.GitMachete.BaseSlideOutBranchAction.notification.title.slide-out-info.canceled");
val message = format(getString("action.GitMachete.BaseSlideOutBranchAction.notification.message.slide-out-info.canceled"), branchName);
IntelliJNotificationCompat.notifyInfo(project, title, message);
}
}
}.queue();
}
Aggregations