boolean () { DialogWrapper dialog = new DialogWrapper(true) { { setTitle(LangBundle.message("dialog.title.registry")); setModal(true); init(); invalidateActions(); } private AbstractAction myCloseAction; @Nullable @Override protected JComponent createNorthPanel() { if (ApplicationManager.getApplication().isInternal()) { return null; } String warning = new HtmlBuilder().append( HtmlChunk.tag("b").addText( IdeBundle.message("registry.change.warning", ApplicationNamesInfo.getInstance().getFullProductName()) ) ).wrapWithHtmlBody().toString(); JLabel warningLabel = new JLabel(warning); warningLabel.setIcon(UIUtil.getWarningIcon()); warningLabel.setForeground(JBColor.RED); return warningLabel; } @Override protected JComponent createCenterPanel() { return myContent; } @Override protected void dispose() { super.dispose(); Disposer.dispose(RegistryUi.this); } @Override protected String getDimensionServiceKey() { return "Registry"; } @Override public JComponent getPreferredFocusedComponent() { return myTable; } @Override protected Action @NotNull [] createActions() { return new Action[]{myRestoreDefaultsAction, myCloseAction}; } @Override protected void createDefaultActions() { super.createDefaultActions(); myCloseAction = new AbstractAction(IdeBundle.message("registry.close.action.text")) { @Override public void actionPerformed(@NotNull ActionEvent e) { processClose(); doOKAction(); } }; myCloseAction.putValue(DialogWrapper.DEFAULT_ACTION, true); } @Override public void doCancelAction() { final TableCellEditor cellEditor = myTable.getCellEditor(); if (cellEditor != null) { cellEditor.stopCellEditing(); } processClose(); super.doCancelAction(); } }; return dialog.showAndGet(); }