void (@NotNull Project project, @NotNull OptionContainer data, @NotNull OptPane pane, @NlsContexts.DialogTitle String title, @NonNls String helpId, @NotNull Runnable onSuccess) { // TODO: execute validator on focus DialogBuilder builder = new DialogBuilder(project).title(title); if (helpId != null) { builder.setHelpId(helpId); } JComponent component = OptionPaneRenderer.getInstance().render(data.getOptionController(), pane, builder, project); builder.setCenterPanel(component); JComponent toFocus = UIUtil.uiTraverser(component) .filter(JComponent.class) .find(c -> c instanceof JTextComponent || c instanceof JComboBox<?> || c instanceof AbstractButton); if (toFocus != null) { builder.setPreferredFocusComponent(toFocus); } if (builder.showAndGet()) { onSuccess.run(); } }