boolean (int count) { return MessageDialogBuilder.yesNo(DiffBundle.message("confirm.delete"), DiffBundle.message("delete.0.items", count)) .yesText(CommonBundle.message("button.delete")) .noText(CommonBundle.getCancelButtonText()) .doNotAsk(new DoNotAskOption() { @Override public boolean isToBeShown() { return WarnOnDeletion.isWarnWhenDeleteItems(); } @Override public void setToBeShown(boolean value, int exitCode) { WarnOnDeletion.setWarnWhenDeleteItems(value); } @Override public boolean canBeHidden() { return true; } @Override public boolean shouldSaveOptionsOnCancel() { return true; } @NotNull @Override public String getDoNotShowMessage() { return DiffBundle.message("do.not.ask.me.again"); } }) .ask(myProject); }