Search in sources :

Example 1 with ComboboxWithBrowseButton

use of com.intellij.ui.ComboboxWithBrowseButton in project intellij-community by JetBrains.

the class SetBackgroundImageDialog method createUIComponents.

private void createUIComponents() {
    ComboBox<String> comboBox = new ComboBox<>(new CollectionComboBoxModel<String>(), 100);
    myPathField = new ComboboxWithBrowseButton(comboBox);
}
Also used : ComboBox(com.intellij.openapi.ui.ComboBox) ComboboxWithBrowseButton(com.intellij.ui.ComboboxWithBrowseButton)

Example 2 with ComboboxWithBrowseButton

use of com.intellij.ui.ComboboxWithBrowseButton in project azure-tools-for-java by Microsoft.

the class SparkSubmissionContentPanel method addSparkClustersLineItem.

private void addSparkClustersLineItem() {
    JLabel sparkClusterLabel = new JLabel("Spark clusters(Linux only)");
    sparkClusterLabel.setToolTipText("The HDInsight Spark cluster you want to submit your application to. Only Linux cluster is supported.");
    GridBagConstraints c11 = new GridBagConstraints();
    c11.gridx = 0;
    c11.gridy = 0;
    c11.insets = new Insets(margin, margin, 0, margin);
    add(sparkClusterLabel, new GridBagConstraints(0, displayLayoutCurrentRow, 1, 1, 0, 0, GridBagConstraints.WEST, GridBagConstraints.NONE, new Insets(margin, margin, 0, margin), 0, 0));
    clustersListComboBox = new ComboboxWithBrowseButton();
    clustersListComboBox.setButtonIcon(StreamUtil.getImageResourceFile(REFRESH_BUTTON_PATH));
    clustersListComboBox.getButton().setToolTipText("Refresh");
    clustersListComboBox.getButton().addActionListener(new ActionListener() {

        @Override
        public void actionPerformed(ActionEvent e) {
            Cursor cursor = getCursor();
            setCursor(new Cursor(Cursor.WAIT_CURSOR));
            List<IClusterDetail> clusterDetails = ClusterManagerEx.getInstance().getClusterDetails(submitModel.getProject());
            setCursor(cursor);
            submitModel.setClusterComboBoxModel(clusterDetails);
        }
    });
    clustersListComboBox.getComboBox().setToolTipText("The HDInsight Spark cluster you want to submit your application to. Only Linux cluster is supported.");
    clustersListComboBox.getComboBox().addPropertyChangeListener(new PropertyChangeListener() {

        @Override
        public void propertyChange(PropertyChangeEvent evt) {
            if (evt.getPropertyName() == "model" && evt.getNewValue() instanceof DefaultComboBoxModel) {
                int size = ((DefaultComboBoxModel) evt.getNewValue()).getSize();
                setVisibleForFixedErrorMessageLabel(ErrorMessageLabelTag.ClusterName.ordinal(), size <= 0);
            }
        }
    });
    add(clustersListComboBox, new GridBagConstraints(1, displayLayoutCurrentRow, 0, 1, 1, 0, GridBagConstraints.WEST, GridBagConstraints.HORIZONTAL, new Insets(margin, margin, 0, margin), 0, 0));
    errorMessageLabels[ErrorMessageLabelTag.ClusterName.ordinal()] = new JLabel("Cluster Name Should not be null");
    errorMessageLabels[ErrorMessageLabelTag.ClusterName.ordinal()].setForeground(DarkThemeManager.getInstance().getErrorMessageColor());
    clustersListComboBox.getComboBox().addItemListener(new ItemListener() {

        @Override
        public void itemStateChanged(ItemEvent e) {
            setVisibleForFixedErrorMessageLabel(0, clustersListComboBox.getComboBox().getItemCount() == 0);
        }
    });
    add(errorMessageLabels[ErrorMessageLabelTag.ClusterName.ordinal()], new GridBagConstraints(1, ++displayLayoutCurrentRow, 0, 1, 1, 0, GridBagConstraints.WEST, GridBagConstraints.NONE, new Insets(0, margin, 0, 0), 0, 0));
}
Also used : PropertyChangeEvent(java.beans.PropertyChangeEvent) ItemEvent(java.awt.event.ItemEvent) PropertyChangeListener(java.beans.PropertyChangeListener) ActionEvent(java.awt.event.ActionEvent) ActionListener(java.awt.event.ActionListener) ComboboxWithBrowseButton(com.intellij.ui.ComboboxWithBrowseButton) ArrayList(java.util.ArrayList) List(java.util.List) ItemListener(java.awt.event.ItemListener)

Example 3 with ComboboxWithBrowseButton

use of com.intellij.ui.ComboboxWithBrowseButton in project intellij-plugins by JetBrains.

the class DartGeneratorPeer method createUIComponents.

private void createUIComponents() {
    mySdkPathComboWithBrowse = new ComboboxWithBrowseButton(new ComboBox<>());
    myDartiumPathComboWithBrowse = new ComboboxWithBrowseButton(new ComboBox<>());
}
Also used : ComboboxWithBrowseButton(com.intellij.ui.ComboboxWithBrowseButton) ComboBox(com.intellij.openapi.ui.ComboBox)

Example 4 with ComboboxWithBrowseButton

use of com.intellij.ui.ComboboxWithBrowseButton in project intellij by bazelbuild.

the class BlazeCreateResourceDirectoryDialog method setupUi.

/**
 * Initially generated by IntelliJ from a .form file.
 */
private void setupUi() {
    myContentPanel = new JPanel();
    myContentPanel.setLayout(new GridLayoutManager(5, 2, new Insets(0, 0, 0, 0), -1, -1));
    myContentPanel.setPreferredSize(new Dimension(800, 400));
    myResourceTypeComboBox = new JComboBox();
    myContentPanel.add(myResourceTypeComboBox, new GridConstraints(1, 1, 1, 1, GridConstraints.ANCHOR_WEST, GridConstraints.FILL_HORIZONTAL, GridConstraints.SIZEPOLICY_CAN_GROW, GridConstraints.SIZEPOLICY_FIXED, null, null, null, 0, false));
    final JBLabel jBLabel1 = new JBLabel();
    jBLabel1.setText("Resource type:");
    jBLabel1.setDisplayedMnemonic('R');
    jBLabel1.setDisplayedMnemonicIndex(0);
    myContentPanel.add(jBLabel1, new GridConstraints(1, 0, 1, 1, GridConstraints.ANCHOR_WEST, GridConstraints.FILL_NONE, GridConstraints.SIZEPOLICY_FIXED, GridConstraints.SIZEPOLICY_FIXED, null, null, null, 0, false));
    myDeviceConfiguratorWrapper = new JPanel();
    myDeviceConfiguratorWrapper.setLayout(new BorderLayout(0, 0));
    myContentPanel.add(myDeviceConfiguratorWrapper, new GridConstraints(3, 0, 1, 2, GridConstraints.ANCHOR_CENTER, GridConstraints.FILL_BOTH, GridConstraints.SIZEPOLICY_CAN_SHRINK | GridConstraints.SIZEPOLICY_CAN_GROW, GridConstraints.SIZEPOLICY_CAN_SHRINK | GridConstraints.SIZEPOLICY_CAN_GROW, null, null, null, 0, false));
    final JLabel label1 = new JLabel();
    label1.setText("Directory name:");
    label1.setDisplayedMnemonic('D');
    label1.setDisplayedMnemonicIndex(0);
    myContentPanel.add(label1, new GridConstraints(0, 0, 1, 1, GridConstraints.ANCHOR_WEST, GridConstraints.FILL_NONE, GridConstraints.SIZEPOLICY_FIXED, GridConstraints.SIZEPOLICY_FIXED, null, null, null, 0, false));
    myDirectoryNameTextField = new JTextField();
    myDirectoryNameTextField.setEnabled(true);
    myContentPanel.add(myDirectoryNameTextField, new GridConstraints(0, 1, 1, 1, GridConstraints.ANCHOR_WEST, GridConstraints.FILL_HORIZONTAL, GridConstraints.SIZEPOLICY_WANT_GROW, GridConstraints.SIZEPOLICY_FIXED, null, new Dimension(150, -1), null, 0, false));
    myErrorLabel = new JBLabel();
    myContentPanel.add(myErrorLabel, new GridConstraints(4, 0, 1, 2, GridConstraints.ANCHOR_CENTER, GridConstraints.FILL_BOTH, GridConstraints.SIZEPOLICY_FIXED, GridConstraints.SIZEPOLICY_FIXED, null, null, null, 0, false));
    myResDirLabel = new JBLabel();
    myResDirLabel.setText("Base directory:");
    myResDirLabel.setDisplayedMnemonic('B');
    myResDirLabel.setDisplayedMnemonicIndex(0);
    myContentPanel.add(myResDirLabel, new GridConstraints(2, 0, 1, 1, GridConstraints.ANCHOR_WEST, GridConstraints.FILL_NONE, GridConstraints.SIZEPOLICY_FIXED, GridConstraints.SIZEPOLICY_FIXED, null, null, null, 0, false));
    myResDirCombo = new ComboboxWithBrowseButton();
    myContentPanel.add(myResDirCombo, new GridConstraints(2, 1, 1, 1, GridConstraints.ANCHOR_WEST, GridConstraints.FILL_HORIZONTAL, GridConstraints.SIZEPOLICY_CAN_GROW, GridConstraints.SIZEPOLICY_FIXED, null, null, null, 0, false));
    jBLabel1.setLabelFor(myResourceTypeComboBox);
    label1.setLabelFor(myDirectoryNameTextField);
    myResDirLabel.setLabelFor(myResourceTypeComboBox);
}
Also used : JPanel(javax.swing.JPanel) Insets(java.awt.Insets) GridLayoutManager(com.intellij.uiDesigner.core.GridLayoutManager) JComboBox(javax.swing.JComboBox) BorderLayout(java.awt.BorderLayout) GridConstraints(com.intellij.uiDesigner.core.GridConstraints) JBLabel(com.intellij.ui.components.JBLabel) ComboboxWithBrowseButton(com.intellij.ui.ComboboxWithBrowseButton) JLabel(javax.swing.JLabel) Dimension(java.awt.Dimension) JTextField(javax.swing.JTextField)

Example 5 with ComboboxWithBrowseButton

use of com.intellij.ui.ComboboxWithBrowseButton in project intellij by bazelbuild.

the class BlazeCreateXmlResourcePanel method setupUi.

/**
 * Initially generated by IntelliJ from a .form file.
 */
private void setupUi() {
    myPanel = new JPanel();
    myPanel.setLayout(new GridLayoutManager(6, 2, new Insets(0, 0, 5, 0), -1, -1));
    myNameLabel = new JBLabel();
    myNameLabel.setText("Resource name:");
    myNameLabel.setDisplayedMnemonic('N');
    myNameLabel.setDisplayedMnemonicIndex(9);
    myPanel.add(myNameLabel, new GridConstraints(0, 0, 1, 1, GridConstraints.ANCHOR_WEST, GridConstraints.FILL_NONE, GridConstraints.SIZEPOLICY_FIXED, GridConstraints.SIZEPOLICY_FIXED, null, null, null, 0, false));
    myNameField = new JTextField();
    myPanel.add(myNameField, new GridConstraints(0, 1, 1, 1, GridConstraints.ANCHOR_WEST, GridConstraints.FILL_HORIZONTAL, GridConstraints.SIZEPOLICY_WANT_GROW, GridConstraints.SIZEPOLICY_FIXED, null, new Dimension(150, -1), null, 0, false));
    myFileNameLabel = new JBLabel();
    myFileNameLabel.setText("File name:");
    myFileNameLabel.setDisplayedMnemonic('F');
    myFileNameLabel.setDisplayedMnemonicIndex(0);
    myPanel.add(myFileNameLabel, new GridConstraints(3, 0, 1, 1, GridConstraints.ANCHOR_WEST, GridConstraints.FILL_NONE, GridConstraints.SIZEPOLICY_FIXED, GridConstraints.SIZEPOLICY_FIXED, null, null, null, 0, false));
    myDirectoriesPanel = new JPanel();
    myDirectoriesPanel.setLayout(new BorderLayout(0, 0));
    myPanel.add(myDirectoriesPanel, new GridConstraints(5, 0, 1, 2, GridConstraints.ANCHOR_CENTER, GridConstraints.FILL_BOTH, GridConstraints.SIZEPOLICY_CAN_SHRINK | GridConstraints.SIZEPOLICY_CAN_GROW, GridConstraints.SIZEPOLICY_CAN_SHRINK | GridConstraints.SIZEPOLICY_CAN_GROW, null, null, null, 0, false));
    myDirectoriesLabel = new JBLabel();
    myDirectoriesLabel.setText("Create the resource in directories:");
    myDirectoriesLabel.setDisplayedMnemonic('C');
    myDirectoriesLabel.setDisplayedMnemonicIndex(0);
    myPanel.add(myDirectoriesLabel, new GridConstraints(4, 0, 1, 2, GridConstraints.ANCHOR_WEST, GridConstraints.FILL_NONE, GridConstraints.SIZEPOLICY_FIXED, GridConstraints.SIZEPOLICY_FIXED, null, null, null, 0, false));
    myValueLabel = new JBLabel();
    myValueLabel.setText("Resource value:");
    myValueLabel.setDisplayedMnemonic('V');
    myValueLabel.setDisplayedMnemonicIndex(9);
    myPanel.add(myValueLabel, new GridConstraints(1, 0, 1, 1, GridConstraints.ANCHOR_WEST, GridConstraints.FILL_NONE, GridConstraints.SIZEPOLICY_FIXED, GridConstraints.SIZEPOLICY_FIXED, null, null, null, 0, false));
    myValueField = new JTextField();
    myPanel.add(myValueField, new GridConstraints(1, 1, 1, 1, GridConstraints.ANCHOR_WEST, GridConstraints.FILL_HORIZONTAL, GridConstraints.SIZEPOLICY_WANT_GROW, GridConstraints.SIZEPOLICY_FIXED, null, new Dimension(150, -1), null, 0, false));
    myFileNameCombo = new JComboBox();
    myFileNameCombo.setEditable(true);
    myPanel.add(myFileNameCombo, new GridConstraints(3, 1, 1, 1, GridConstraints.ANCHOR_WEST, GridConstraints.FILL_HORIZONTAL, GridConstraints.SIZEPOLICY_CAN_GROW, GridConstraints.SIZEPOLICY_FIXED, null, null, null, 0, false));
    myResDirLabel = new JBLabel();
    myResDirLabel.setText("Base directory:");
    myResDirLabel.setDisplayedMnemonic('B');
    myResDirLabel.setDisplayedMnemonicIndex(0);
    myPanel.add(myResDirLabel, new GridConstraints(2, 0, 1, 1, GridConstraints.ANCHOR_WEST, GridConstraints.FILL_NONE, GridConstraints.SIZEPOLICY_FIXED, GridConstraints.SIZEPOLICY_FIXED, null, null, null, 0, false));
    myResDirCombo = new ComboboxWithBrowseButton();
    myPanel.add(myResDirCombo, new GridConstraints(2, 1, 1, 1, GridConstraints.ANCHOR_WEST, GridConstraints.FILL_HORIZONTAL, GridConstraints.SIZEPOLICY_CAN_GROW, GridConstraints.SIZEPOLICY_FIXED, null, null, null, 0, false));
    myNameLabel.setLabelFor(myNameField);
    myFileNameLabel.setLabelFor(myFileNameCombo);
    myValueLabel.setLabelFor(myValueField);
}
Also used : JPanel(javax.swing.JPanel) Insets(java.awt.Insets) GridLayoutManager(com.intellij.uiDesigner.core.GridLayoutManager) BorderLayout(java.awt.BorderLayout) JComboBox(javax.swing.JComboBox) JBLabel(com.intellij.ui.components.JBLabel) GridConstraints(com.intellij.uiDesigner.core.GridConstraints) ComboboxWithBrowseButton(com.intellij.ui.ComboboxWithBrowseButton) Dimension(java.awt.Dimension) JTextField(javax.swing.JTextField)

Aggregations

ComboboxWithBrowseButton (com.intellij.ui.ComboboxWithBrowseButton)8 JBLabel (com.intellij.ui.components.JBLabel)3 GridConstraints (com.intellij.uiDesigner.core.GridConstraints)3 GridLayoutManager (com.intellij.uiDesigner.core.GridLayoutManager)3 BorderLayout (java.awt.BorderLayout)3 Dimension (java.awt.Dimension)3 Insets (java.awt.Insets)3 ActionEvent (java.awt.event.ActionEvent)3 ActionListener (java.awt.event.ActionListener)3 JPanel (javax.swing.JPanel)3 JTextField (javax.swing.JTextField)3 ComboBox (com.intellij.openapi.ui.ComboBox)2 JComboBox (javax.swing.JComboBox)2 JLabel (javax.swing.JLabel)2 IdDisplay (com.android.sdklib.repository.IdDisplay)1 AvdComboBox (com.android.tools.idea.run.AvdComboBox)1 TemplateKindCombo (com.intellij.ide.actions.TemplateKindCombo)1 Disposable (com.intellij.openapi.Disposable)1 DataContext (com.intellij.openapi.actionSystem.DataContext)1 Module (com.intellij.openapi.module.Module)1