void (@Nullable JComponent parentComponent) { ApplicationEx app = (ApplicationEx)ApplicationManager.getApplication(); String title = IdeBundle.message("dialog.title.restart.required"); String message = IdeBundle.message("dialog.message.must.be.restarted.for.changes.to.take.effect", ApplicationNamesInfo.getInstance().getFullProductName()); String okText = IdeBundle.message("button.now", app.isRestartCapable() ? 0 : 1); String cancelText = IdeBundle.message("button.later", app.isRestartCapable() ? 0 : 1); int result; if (parentComponent != null) { result = Messages.showOkCancelDialog(parentComponent, message, title, okText, cancelText, Messages.getQuestionIcon()); } else { result = Messages.showOkCancelDialog(message, title, okText, cancelText, Messages.getQuestionIcon()); } if (result == Messages.OK) { ApplicationManager.getApplication().invokeLater(() -> app.restart(true), ModalityState.nonModal()); } }