void (final Project project, @DialogMessage String message, @DialogTitle String title) { Runnable task = () -> Messages.showErrorDialog(project, message, title); WaitForProgressToShow.runOrInvokeLaterAboveProgress(task, null, project); }