void (final Project project, final String targetClassName) { ApplicationManager.getApplication().invokeLater(() -> Messages.showErrorDialog(project, JavaBundle.message("intention.error.cannot.create.class.message", targetClassName), JavaBundle.message("intention.error.cannot.create.class.title"))); }