use of com.intellij.openapi.ui.VerticalFlowLayout in project intellij-community by JetBrains.
the class GrIntroduceParameterDialog method createCenterPanel.
@Override
protected JComponent createCenterPanel() {
JPanel north = new JPanel();
north.setLayout(new VerticalFlowLayout(VerticalFlowLayout.TOP, 0, 0, true, true));
final JPanel namePanel = createNamePanel();
namePanel.setAlignmentX(Component.LEFT_ALIGNMENT);
north.add(namePanel);
createCheckBoxes(north);
myGetterPanel = createFieldPanel();
myGetterPanel.setAlignmentX(Component.LEFT_ALIGNMENT);
north.add(myGetterPanel);
final JPanel root = new JPanel(new BorderLayout());
mySignaturePanel = createSignaturePanel();
root.add(mySignaturePanel, BorderLayout.CENTER);
root.add(north, BorderLayout.NORTH);
return root;
}
use of com.intellij.openapi.ui.VerticalFlowLayout in project intellij-community by JetBrains.
the class CoverageConfigurable method createEditor.
@NotNull
protected JComponent createEditor() {
JPanel result = new JPanel(new GridBagLayout());
final DefaultComboBoxModel runnersModel = new DefaultComboBoxModel();
myCoverageRunnerCb = new JComboBox(runnersModel);
final JavaCoverageEnabledConfiguration javaCoverageEnabledConfiguration = JavaCoverageEnabledConfiguration.getFrom(myConfig);
LOG.assertTrue(javaCoverageEnabledConfiguration != null);
final JavaCoverageEngine provider = javaCoverageEnabledConfiguration.getCoverageProvider();
for (CoverageRunner runner : Extensions.getExtensions(CoverageRunner.EP_NAME)) {
if (runner.acceptsCoverageEngine(provider)) {
runnersModel.addElement(new CoverageRunnerItem(runner));
}
}
myCoverageRunnerCb.setRenderer(new ListCellRendererWrapper<CoverageRunnerItem>() {
@Override
public void customize(JList list, CoverageRunnerItem value, int index, boolean selected, boolean hasFocus) {
if (value != null) {
setText(value.getPresentableName());
}
}
});
myCoverageRunnerCb.addActionListener(new ActionListener() {
public void actionPerformed(final ActionEvent e) {
final CoverageRunner runner = getSelectedRunner();
enableTracingPanel(runner != null && runner.isCoverageByTestApplicable());
myTrackPerTestCoverageCb.setEnabled(myTracingRb.isSelected() && canHavePerTestCoverage() && runner != null && runner.isCoverageByTestApplicable());
}
});
myRunnerPanel = new JPanel(new GridBagLayout());
myRunnerPanel.setBorder(BorderFactory.createEmptyBorder(0, 0, 0, 0));
myRunnerPanel.add(new JLabel("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, JBUI.emptyInsets(), 0, 0));
final JPanel cPanel = new JPanel(new VerticalFlowLayout());
mySamplingRb = new JRadioButton("Sampling");
cPanel.add(mySamplingRb);
myTracingRb = new JRadioButton("Tracing");
cPanel.add(myTracingRb);
final ButtonGroup group = new ButtonGroup();
group.add(mySamplingRb);
group.add(myTracingRb);
ActionListener samplingListener = new ActionListener() {
public void actionPerformed(final ActionEvent e) {
final CoverageRunner runner = getSelectedRunner();
myTrackPerTestCoverageCb.setEnabled(canHavePerTestCoverage() && myTracingRb.isSelected() && runner != null && runner.isCoverageByTestApplicable());
}
};
mySamplingRb.addActionListener(samplingListener);
myTracingRb.addActionListener(samplingListener);
myTrackPerTestCoverageCb = new JCheckBox("Track per test coverage");
final JBPanel tracingPanel = JBUI.Panels.simplePanel(myTrackPerTestCoverageCb).withBorder(JBUI.Borders.emptyLeft(15));
cPanel.add(tracingPanel);
myRunnerPanel.add(cPanel, new GridBagConstraints(0, 1, GridBagConstraints.REMAINDER, 1, 1, 1, GridBagConstraints.WEST, GridBagConstraints.NONE, JBUI.emptyInsets(), 0, 0));
final GridBagConstraints gc = new GridBagConstraints(0, GridBagConstraints.RELATIVE, 1, 1, 1, 0, GridBagConstraints.NORTHWEST, GridBagConstraints.HORIZONTAL, JBUI.emptyInsets(), 0, 0);
result.add(myRunnerPanel, gc);
JPanel panel = new JPanel(new GridBagLayout());
panel.setBorder(IdeBorderFactory.createTitledBorder(ExecutionBundle.message("record.coverage.filters.title"), false));
myClassFilterEditor = new MyClassFilterEditor(myProject);
final GridBagConstraints bagConstraints = new GridBagConstraints(0, GridBagConstraints.RELATIVE, 1, 1, 1, 1, GridBagConstraints.NORTHWEST, GridBagConstraints.BOTH, JBUI.emptyInsets(), 0, 0);
panel.add(myClassFilterEditor, bagConstraints);
bagConstraints.weighty = 0;
myTrackTestSourcesCb = new JCheckBox("Enable coverage in test folders");
panel.add(myTrackTestSourcesCb, bagConstraints);
gc.weighty = 1;
gc.fill = GridBagConstraints.BOTH;
result.add(panel, gc);
myCoverageNotSupportedLabel = new JLabel(CodeInsightBundle.message("code.coverage.is.not.supported"));
myCoverageNotSupportedLabel.setIcon(AllIcons.General.WarningDialog);
result.add(myCoverageNotSupportedLabel, gc);
return result;
}
use of com.intellij.openapi.ui.VerticalFlowLayout in project intellij-community by JetBrains.
the class ChooseCheckoutMode method createOptionsPanel.
private JPanel createOptionsPanel() {
final JPanel result = new JPanel(new VerticalFlowLayout());
result.add(myMakeNewFilesReadOnly);
result.add(myPruneEmptyDirectories);
result.add(myChangeKeywordSubstitutionPanel.getComponent());
result.add(myDateOrRevisionOrTagSettings.getPanel());
return result;
}
use of com.intellij.openapi.ui.VerticalFlowLayout in project intellij-community by JetBrains.
the class MergedCompositeConfigurable method createPanel.
@NotNull
static JPanel createPanel(boolean isUseTitledBorder) {
int verticalGap = TitledSeparator.TOP_INSET;
JPanel panel = new JPanel(new VerticalFlowLayout(VerticalFlowLayout.TOP, 0, isUseTitledBorder ? 0 : verticalGap, true, true));
// VerticalFlowLayout incorrectly use vertical gap as top inset
if (!isUseTitledBorder) {
panel.setBorder(new EmptyBorder(-verticalGap, 0, 0, 0));
}
return panel;
}
use of com.intellij.openapi.ui.VerticalFlowLayout in project intellij-community by JetBrains.
the class ChooseComponentsToExportDialog method createSouthPanel.
@Override
protected JComponent createSouthPanel() {
final JComponent buttons = super.createSouthPanel();
if (!myShowFilePath)
return buttons;
final JPanel panel = new JPanel(new VerticalFlowLayout());
panel.add(myPathPanel);
panel.add(buttons);
return panel;
}
Aggregations