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);
}
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));
}
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<>());
}
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);
}
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);
}
Aggregations