private JPanel createModePanel(GridBagConstraints gc) {
    JPanel panel = new JPanel(new GridBagLayout());

    JLabel modeLabel = createLabelFor(JavaCompilerBundle.message("label.debugger.mode"), myModeCombo);
    JLabel transportLabel = createLabelFor(JavaCompilerBundle.message("label.transport"), myTransportCombo);
    JLabel hostLabel = createLabelFor(JavaCompilerBundle.message("label.host"), myHostName);
    JLabel portLabel = createLabelFor(JavaCompilerBundle.message("label.port"), myPort);

    gc.gridwidth = 2;
    panel.add(modeLabel, gc);

    gc.gridx += 2;
    gc.gridwidth = 1;
    gc.insets = JBUI.insetsTop(4);
    panel.add(myModeCombo, gc);

    gc.gridx++;
    gc.gridwidth = 2;
    gc.fill = GridBagConstraints.NONE;
    gc.insets = JBUI.insets(4, 20, 0, 8);
    panel.add(myAutoRestart, gc);

    gc.gridx += 2;
    gc.gridwidth = 1;
    gc.weightx = 1.0;
    gc.fill = GridBagConstraints.HORIZONTAL;
    gc.insets = JBInsets.emptyInsets();
    panel.add(new JPanel(), gc);

    if (SystemInfo.isWindows) {
      JLabel addressLabel = createLabelFor(JavaCompilerBundle.message("label.address"), myAddress);

      addressLabel.setVisible(false);
      myAddress.setVisible(false);

      gc.gridx = 0;
      gc.gridy++;
      gc.weightx = 0.0;
      gc.gridwidth = 2;
      gc.fill = GridBagConstraints.NONE;
      gc.insets = JBUI.insets(4, 0, 0, 8);
      panel.add(transportLabel, gc);

      gc.gridx += 2;
      gc.gridwidth = 1;
      gc.fill = GridBagConstraints.HORIZONTAL;
      gc.insets = JBUI.insetsTop(4);
      panel.add(myTransportCombo, gc);

      gc.gridx++;
      gc.weightx = 1.0;
      gc.gridwidth = 2;
      gc.fill = GridBagConstraints.REMAINDER;
      panel.add(new JPanel(), gc);

      gc.gridy++;
      gc.gridx = 0;
      gc.weightx = 0.0;
      gc.gridwidth = 1;
      gc.insets = JBUI.insets(4, 0, 0, 8);
      gc.fill = GridBagConstraints.NONE;
      panel.add(addressLabel, gc);

      gc.gridx++;
      gc.gridwidth = 2;
      gc.insets = JBUI.insetsTop(4);
      gc.fill = GridBagConstraints.HORIZONTAL;
      panel.add(myAddress, gc);

      myTransportCombo.addActionListener(e -> {
        boolean isShmem = myTransportCombo.getSelectedItem() == Transport.SHMEM;

        hostLabel.setVisible(!isShmem);
        myPort.setVisible(!isShmem);
        myHostName.setVisible(!isShmem);
        portLabel.setVisible(!isShmem);

        addressLabel.setVisible(isShmem);
        myAddress.setVisible(isShmem);
      });
    }

    gc.gridy++;
    gc.gridx = 0;
    gc.weightx = 0.0;
    gc.gridwidth = 1;
    gc.insets = JBUI.insets(4, 0, 0, 8);
    gc.fill = GridBagConstraints.NONE;
    panel.add(hostLabel, gc);

    gc.gridx++;
    gc.gridwidth = 2;
    gc.insets = JBUI.insetsTop(4);
    gc.fill = GridBagConstraints.HORIZONTAL;
    panel.add(myHostName, gc);

    gc.gridx += 2;
    gc.gridwidth = 1;
    gc.fill = GridBagConstraints.NONE;
    gc.insets = JBUI.insets(4, 20, 0, 8);
    panel.add(portLabel, gc);

    gc.gridx++;
    gc.insets = JBUI.insetsTop(4);
    panel.add(myPort, gc);

    gc.gridx++;
    gc.weightx = 1.0;
    gc.fill = GridBagConstraints.HORIZONTAL;
    gc.insets = JBInsets.emptyInsets();
    panel.add(new JPanel(), gc);

    return panel;
  }
private JPanel createModePanel(GridBagConstraints gc)