Result (@NotNull final Project project, @NotNull final @NlsContexts.DialogMessage String message) { boolean result = runOrInvokeAndWait(() -> { String title = UsageViewBundle.message("find.excessive.usages.title"); return MessageDialogBuilder.okCancel(title, message).yesText(UsageViewBundle.message("button.text.continue")) .noText(UsageViewBundle.message("button.text.abort")).icon(UIUtil.getWarningIcon()).ask(project); }); return result ? Result.CONTINUE : Result.ABORT; }