private static @NotNull JPanel buildPanel(@NotNull Project project,
                                   @NotNull ComboBox<?> sdkComboBox,
                                   @NotNull JComponent additionalAction,
                                   @NotNull PyInstalledPackagesPanel installedPackagesPanel,
                                   @NotNull PackagesNotificationPanel packagesNotificationPanel,
                                   @Nullable Pair<PyCustomSdkUiProvider, Disposable> customizer) {
    final JPanel result = new JPanel(new GridBagLayout());

    final GridBagConstraints c = new GridBagConstraints();
    c.fill = GridBagConstraints.HORIZONTAL;
    c.insets = JBUI.insets(2);

    c.gridx = 0;
    c.gridy = 0;
    JLabel label = new JLabel(PyBundle.message("active.sdk.dialog.project.interpreter"));
    label.setLabelFor(sdkComboBox);
    result.add(label, c);

    c.gridx = 1;
    c.gridy = 0;
    c.weightx = 0.1;
    result.add(sdkComboBox, c);

    c.insets = JBUI.insets(2, 0, 2, 2);
    c.gridx = 2;
    c.gridy = 0;
    c.weightx = 0.0;
    result.add(additionalAction, c);

    if (customizer != null) {
      customizer.first.customizeActiveSdkPanel(project, sdkComboBox, result, c, customizer.second);
    }

    c.insets = JBUI.insets(2, 2, 0, 2);
    c.gridx = 0;
    c.gridy++;
    c.gridwidth = 3;
    c.weightx = 0.0;
    result.add(buildToolWindowAdvertisement(project), c);

    c.gridx = 0;
    c.gridy++;
    c.weighty = 1.;
    c.gridwidth = 3;
    c.gridheight = GridBagConstraints.RELATIVE;
    c.fill = GridBagConstraints.BOTH;
    result.add(installedPackagesPanel, c);

    c.gridheight = GridBagConstraints.REMAINDER;
    c.gridx = 0;
    c.gridy++;
    c.gridwidth = 3;
    c.weighty = 0.;
    c.fill = GridBagConstraints.HORIZONTAL;
    c.anchor = GridBagConstraints.SOUTH;

    result.add(packagesNotificationPanel.getComponent(), c);

    return result;
  }
private static @NotNull JPanel buildPanel(@NotNull Project project,
                                   @NotNull ComboBox<?> sdkComboBox,
                                   @NotNull JComponent additionalAction,
                                   @NotNull PyInstalledPackagesPanel installedPackagesPanel,
                                   @NotNull PackagesNotificationPanel packagesNotificationPanel,
                                   @Nullable Pair<PyCustomSdkUiProvider, Disposable> customizer)