Search in sources :

Example 1 with VerticalFlowLayout

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;
}
Also used : VerticalFlowLayout(com.intellij.openapi.ui.VerticalFlowLayout)

Example 2 with VerticalFlowLayout

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;
}
Also used : JavaCoverageEngine(com.intellij.coverage.JavaCoverageEngine) CoverageRunner(com.intellij.coverage.CoverageRunner) ActionEvent(java.awt.event.ActionEvent) JBPanel(com.intellij.ui.components.JBPanel) ActionListener(java.awt.event.ActionListener) VerticalFlowLayout(com.intellij.openapi.ui.VerticalFlowLayout) NotNull(org.jetbrains.annotations.NotNull)

Example 3 with VerticalFlowLayout

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;
}
Also used : VerticalFlowLayout(com.intellij.openapi.ui.VerticalFlowLayout)

Example 4 with VerticalFlowLayout

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;
}
Also used : EmptyBorder(javax.swing.border.EmptyBorder) VerticalFlowLayout(com.intellij.openapi.ui.VerticalFlowLayout) NotNull(org.jetbrains.annotations.NotNull)

Example 5 with VerticalFlowLayout

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;
}
Also used : VerticalFlowLayout(com.intellij.openapi.ui.VerticalFlowLayout)

Aggregations

VerticalFlowLayout (com.intellij.openapi.ui.VerticalFlowLayout)34 Nullable (org.jetbrains.annotations.Nullable)8 JBLabel (com.intellij.ui.components.JBLabel)7 NotNull (org.jetbrains.annotations.NotNull)6 ActionEvent (java.awt.event.ActionEvent)4 ActionListener (java.awt.event.ActionListener)4 EditorTextField (com.intellij.ui.EditorTextField)3 TitledSeparator (com.intellij.ui.TitledSeparator)3 JBList (com.intellij.ui.components.JBList)3 JBScrollPane (com.intellij.ui.components.JBScrollPane)3 FormBuilder (com.intellij.util.ui.FormBuilder)3 ArrayList (java.util.ArrayList)3 Document (com.intellij.openapi.editor.Document)2 ComboBox (com.intellij.openapi.ui.ComboBox)2 JBPanel (com.intellij.ui.components.JBPanel)2 JCheckBox (javax.swing.JCheckBox)2 JPanel (javax.swing.JPanel)2 Density (com.android.resources.Density)1 LegendComponent (com.android.tools.adtui.LegendComponent)1 ImageComponent (com.android.tools.idea.ui.ImageComponent)1