DialogWrapper (@Nullable Project project, @NotNull String groupID, @NlsContexts.DialogTitle String groupName, @Nullable AnAction targetAction) { ToolbarCustomizableActionsPanel panel = new ToolbarCustomizableActionsPanel(groupID, groupName); return new DialogWrapper(project, true) { { setTitle(IdeBundle.message("dialog.title.customize.0", groupName)); init(); setSize(600, 600); } @Override public @Nullable JComponent getPreferredFocusedComponent() { return panel.getPreferredFocusedComponent(); } @Override protected @Nullable JComponent createCenterPanel() { panel.reset(); String id = targetAction == null ? null : ActionManager.getInstance().getId(targetAction); if (id != null) { panel.selectAction(id); } return panel.getPanel(); } @Override protected void doOKAction() { try { panel.apply(); } catch (ConfigurationException ex) { LOG.error(ex); } close(OK_EXIT_CODE); } @Override public void doCancelAction() { panel.reset(); super.doCancelAction(); } }; }