void () { ensureEventDispatchThread(); myErrorText = new ErrorText(createContentPaneBorder(), getErrorTextAlignment()); myErrorText.setVisible(false); ComponentAdapter resizeListener = new ComponentAdapter() { private int myHeight; @Override public void componentResized(ComponentEvent e) { resize(e); } @Override public void componentShown(ComponentEvent e) { resize(e); } @Override public void componentHidden(ComponentEvent e) { resize(e); } private void resize(ComponentEvent event) { int height = !myErrorText.isVisible() ? 0 : event.getComponent().getHeight(); if (height != myHeight) { myHeight = height; myResizeInProgress = true; myErrorText.setMinimumSize(new Dimension(0, height)); JRootPane root = myPeer.getRootPane(); if (root != null) { root.validate(); } if (myActualSize != null && !shouldAddErrorNearButtons()) { myPeer.setSize(myActualSize.width, myActualSize.height + height); } myErrorText.revalidate(); myResizeInProgress = false; } } }; myErrorText.addComponentListener(resizeListener); Disposer.register(myDisposable, () -> myErrorText.removeComponentListener(resizeListener)); myRoot.setLayout(createRootLayout()); myPeer.setContentPane(myRoot); AnAction toggleShowOptions = DumbAwareAction.create(e -> expandNextOptionButton()); toggleShowOptions.registerCustomShortcutSet(getDefaultShowPopupShortcut(), myRoot, myDisposable); JComponent titlePane = createTitlePane(); if (titlePane != null) { JPanel northSection = new JPanel(new BorderLayout()); myRoot.add(northSection, BorderLayout.NORTH); northSection.add(titlePane, BorderLayout.CENTER); } JComponent centerSection = new JPanel(new BorderLayout()); myRoot.add(centerSection, BorderLayout.CENTER); JComponent n = createNorthPanel(); if (n != null) { centerSection.add(n, BorderLayout.NORTH); } JComponent centerPanel = createCenterPanel(); if (centerPanel != null) { centerPanel.putClientProperty(DIALOG_CONTENT_PANEL_PROPERTY, true); centerSection.add(centerPanel, BorderLayout.CENTER); if (centerPanel instanceof DialogPanel dialogPanel) { myPreferredFocusedComponentFromPanel = dialogPanel.getPreferredFocusedComponent(); dialogPanel.registerValidators(myDisposable, map -> { setOKActionEnabled(ContainerUtil.and(map.values(), info -> info.okEnabled)); return Unit.INSTANCE; }); myDialogPanel = dialogPanel; } } boolean isVisualPaddingCompensatedOnComponentLevel = centerPanel == null || centerPanel.getClientProperty(IS_VISUAL_PADDING_COMPENSATED_ON_COMPONENT_LEVEL_KEY) == null; if (isVisualPaddingCompensatedOnComponentLevel) { // see comment about visual paddings in the MigLayoutBuilder.build myRoot.setBorder(createContentPaneBorder()); } if (myCreateSouthSection) { JPanel southSection = new JPanel(new BorderLayout()); if (!isVisualPaddingCompensatedOnComponentLevel) { southSection.setBorder(JBUI.Borders.empty(0, 12, 8, 12)); } myRoot.add(southSection, BorderLayout.SOUTH); southSection.add(myErrorText, BorderLayout.CENTER); JComponent south = createSouthPanel(); if (south != null) { southSection.add(south, BorderLayout.SOUTH); } } MnemonicHelper.init(myRoot); if (!postponeValidation()) { startTrackingValidation(); } if (SystemInfoRt.isWindows || (SystemInfoRt.isLinux && Registry.is("ide.linux.enter.on.dialog.triggers.focused.button", true))) { installEnterHook(myRoot, myDisposable); } ActionUtil.initActionContextForComponent(myRoot); }