JComponent () { JPanel result = new JPanel(new GridBagLayout()); final DefaultComboBoxModel<CoverageRunnerItem> runnersModel = new DefaultComboBoxModel<>(); myCoverageRunnerCb = new ComboBox<>(runnersModel); final JavaCoverageEnabledConfiguration javaCoverageEnabledConfiguration = JavaCoverageEnabledConfiguration.getFrom(myConfig); LOG.assertTrue(javaCoverageEnabledConfiguration != null); final JavaCoverageEngine provider = JavaCoverageEngine.getInstance(); for (CoverageRunner runner : CoverageRunner.EP_NAME.getExtensionList()) { if (runner.acceptsCoverageEngine(provider)) { runnersModel.addElement(new CoverageRunnerItem(runner)); } } myCoverageRunnerCb.setRenderer(SimpleListCellRenderer.create("", CoverageRunnerItem::getPresentableName)); myCoverageRunnerCb.addActionListener(new ActionListener() { @Override public void actionPerformed(final ActionEvent e) { setUpBranchCoverage(getSelectedRunner(), myBranchCoverageCb.isSelected(), myTrackPerTestCoverageCb.isSelected()); } }); myRunnerPanel = new JPanel(new GridBagLayout()); myRunnerPanel.setBorder(BorderFactory.createEmptyBorder(0, 0, 0, 0)); myRunnerPanel.add(new JLabel(JavaCoverageBundle.message("run.configuration.choose.coverage.runner")), new GridBagConstraints(0, 0, 1, 1, 0, 1, GridBagConstraints.WEST, GridBagConstraints.NONE, JBUI.insetsRight(10), 0, 0)); myRunnerPanel.add(myCoverageRunnerCb, new GridBagConstraints(1, 0, 1, 1, 1, 1, GridBagConstraints.WEST, GridBagConstraints.NONE, JBInsets.emptyInsets(), 0, 0)); final JPanel cPanel = new JPanel(new VerticalFlowLayout()); myBranchCoverageCb = new JCheckBox(JavaCoverageBundle.message("run.configuration.coverage.branches")); final JPanel branchCoveragePanel = UI.PanelFactory.panel(myBranchCoverageCb) .withComment(JavaCoverageBundle.message("run.configuration.coverage.branches.comment")) .createPanel(); cPanel.add(branchCoveragePanel); final ActionListener branchCoverageListener = new ActionListener() { @Override public void actionPerformed(final ActionEvent e) { setUpBranchCoverage(getSelectedRunner(), myBranchCoverageCb.isSelected(), myTrackPerTestCoverageCb.isSelected()); } }; myBranchCoverageCb.addActionListener(branchCoverageListener); myTrackPerTestCoverageCb = new JCheckBox(JavaCoverageBundle.message("run.configuration.track.per.test.coverage")); final JBPanel<BorderLayoutPanel> testTrackingPanel = JBUI.Panels.simplePanel(myTrackPerTestCoverageCb).withBorder(JBUI.Borders.emptyLeft(15)); cPanel.add(testTrackingPanel); myRunnerPanel.add(cPanel, new GridBagConstraints(0, 1, GridBagConstraints.REMAINDER, 1, 1, 1, GridBagConstraints.WEST, GridBagConstraints.NONE, JBInsets.emptyInsets(), 0, 0)); final GridBagConstraints gc = new GridBagConstraints(0, GridBagConstraints.RELATIVE, 1, 1, 1, 0, GridBagConstraints.NORTHWEST, GridBagConstraints.HORIZONTAL, JBInsets.emptyInsets(), 0, 0); result.add(myRunnerPanel, gc); JPanel panel = new JPanel(new GridBagLayout()); final GridBagConstraints bagConstraints = new GridBagConstraints(0, GridBagConstraints.RELATIVE, 1, 1, 1, 1, GridBagConstraints.NORTHWEST, GridBagConstraints.BOTH, JBInsets.emptyInsets(), 0, 0); //noinspection DialogTitleCapitalization panel.add(new TitledSeparator(JavaCoverageBundle.message("record.coverage.filters.title")), bagConstraints); myClassFilterEditor = new CoverageClassFilterEditor(myProject); panel.add(myClassFilterEditor, bagConstraints); //noinspection DialogTitleCapitalization panel.add(new TitledSeparator(JavaCoverageBundle.message("exclude.coverage.filters.title")), bagConstraints); myExcludeClassFilterEditor = new CoverageClassFilterEditor(myProject) { @NotNull @Override protected ClassFilter createFilter(String pattern) { ClassFilter filter = super.createFilter(pattern); filter.setInclude(false); return filter; } }; panel.add(myExcludeClassFilterEditor, bagConstraints); bagConstraints.weighty = 0; myTrackTestSourcesCb = new JCheckBox(JavaCoverageBundle.message("run.configuration.enable.coverage.in.test.folders")); panel.add(myTrackTestSourcesCb, bagConstraints); gc.weighty = 1; gc.fill = GridBagConstraints.BOTH; result.add(panel, gc); myCoverageNotSupportedLabel = new JLabel(JavaCoverageBundle.message("code.coverage.is.not.supported")); myCoverageNotSupportedLabel.setIcon(AllIcons.General.WarningDialog); result.add(myCoverageNotSupportedLabel, gc); return result; }