Search in sources :

Example 1 with JBTextField

use of com.intellij.ui.components.JBTextField in project buck by facebook.

the class BuckSettingsUI method init.

private void init() {
    setLayout(new BorderLayout());
    JPanel container = this;
    buckPathField = new TextFieldWithBrowseButton();
    FileChooserDescriptor buckFileChooserDescriptor = new FileChooserDescriptor(true, false, false, false, false, false);
    buckPathField.addBrowseFolderListener("", "Buck Executable Path", null, buckFileChooserDescriptor, TextComponentAccessor.TEXT_FIELD_WHOLE_TEXT, false);
    adbPathField = new TextFieldWithBrowseButton();
    FileChooserDescriptor adbFileChooserDescriptor = new FileChooserDescriptor(true, false, false, false, false, false);
    adbPathField.addBrowseFolderListener("", "Adb Executable Path", null, adbFileChooserDescriptor, TextComponentAccessor.TEXT_FIELD_WHOLE_TEXT, false);
    customizedInstallSettingField = new JBTextField();
    customizedInstallSettingField.getEmptyText().setText(CUSTOMIZED_INSTALL_FLAGS_HINT);
    customizedInstallSettingField.setEnabled(false);
    showDebug = new JCheckBox("Show debug in tool window");
    enableAutoDeps = new JCheckBox("Enable auto dependencies");
    runAfterInstall = new JCheckBox("Run after install (-r)");
    multiInstallMode = new JCheckBox("Multi-install mode (-x)");
    uninstallBeforeInstall = new JCheckBox("Uninstall before installing (-u)");
    customizedInstallSetting = new JCheckBox("Use customized install setting:  ");
    initCustomizedInstallCommandListener();
    JPanel buckSettings = new JPanel(new GridBagLayout());
    buckSettings.setBorder(IdeBorderFactory.createTitledBorder("Buck Settings", true));
    container.add(container = new JPanel(new BorderLayout()), BorderLayout.NORTH);
    container.add(buckSettings, BorderLayout.NORTH);
    final GridBagConstraints constraints = new GridBagConstraints(0, 0, 1, 1, 0, 0, GridBagConstraints.WEST, GridBagConstraints.NONE, new Insets(0, 0, 0, 0), 0, 0);
    buckSettings.add(new JLabel("Buck Executable Path:"), constraints);
    constraints.gridx = 1;
    constraints.weightx = 1;
    constraints.fill = GridBagConstraints.HORIZONTAL;
    buckSettings.add(buckPathField, constraints);
    constraints.gridx = 0;
    constraints.gridy = 1;
    constraints.weightx = 1;
    buckSettings.add(new JLabel("Adb Executable Path:"), constraints);
    constraints.gridx = 1;
    constraints.gridy = 1;
    constraints.weightx = 1;
    constraints.fill = GridBagConstraints.HORIZONTAL;
    buckSettings.add(adbPathField, constraints);
    constraints.gridx = 0;
    constraints.gridy = 2;
    buckSettings.add(showDebug, constraints);
    constraints.gridx = 0;
    constraints.gridy = 3;
    buckSettings.add(enableAutoDeps, constraints);
    JPanel installSettings = new JPanel(new BorderLayout());
    installSettings.setBorder(IdeBorderFactory.createTitledBorder("Buck Install Settings", true));
    container.add(container = new JPanel(new BorderLayout()), BorderLayout.SOUTH);
    container.add(installSettings, BorderLayout.NORTH);
    installSettings.add(runAfterInstall, BorderLayout.NORTH);
    installSettings.add(installSettings = new JPanel(new BorderLayout()), BorderLayout.SOUTH);
    installSettings.add(multiInstallMode, BorderLayout.NORTH);
    installSettings.add(installSettings = new JPanel(new BorderLayout()), BorderLayout.SOUTH);
    installSettings.add(uninstallBeforeInstall, BorderLayout.NORTH);
    installSettings.add(installSettings = new JPanel(new BorderLayout()), BorderLayout.SOUTH);
    final GridBagConstraints customConstraints = new GridBagConstraints(0, 0, 1, 1, 0, 0, GridBagConstraints.WEST, GridBagConstraints.NONE, new Insets(0, 0, 0, 0), 0, 0);
    JPanel customizedInstallSetting = new JPanel(new GridBagLayout());
    customizedInstallSetting.add(this.customizedInstallSetting, customConstraints);
    customConstraints.gridx = 1;
    customConstraints.weightx = 1;
    customConstraints.fill = GridBagConstraints.HORIZONTAL;
    customizedInstallSetting.add(customizedInstallSettingField, customConstraints);
    installSettings.add(customizedInstallSetting, BorderLayout.NORTH);
}
Also used : JCheckBox(javax.swing.JCheckBox) JPanel(javax.swing.JPanel) GridBagConstraints(java.awt.GridBagConstraints) TextFieldWithBrowseButton(com.intellij.openapi.ui.TextFieldWithBrowseButton) Insets(java.awt.Insets) BorderLayout(java.awt.BorderLayout) GridBagLayout(java.awt.GridBagLayout) FileChooserDescriptor(com.intellij.openapi.fileChooser.FileChooserDescriptor) JLabel(javax.swing.JLabel) JBTextField(com.intellij.ui.components.JBTextField)

Example 2 with JBTextField

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

the class HgBookmarkDialog method createCenterPanel.

@Override
@NotNull
protected JComponent createCenterPanel() {
    JPanel contentPanel = new JPanel(new GridBagLayout());
    GridBag g = new GridBag().setDefaultInsets(new Insets(0, 0, DEFAULT_VGAP, DEFAULT_HGAP)).setDefaultAnchor(GridBagConstraints.LINE_START).setDefaultFill(GridBagConstraints.HORIZONTAL);
    JLabel icon = new JLabel(UIUtil.getQuestionIcon(), SwingConstants.LEFT);
    myBookmarkName = new JBTextField(13);
    myBookmarkName.getDocument().addDocumentListener(new DocumentAdapter() {

        @Override
        public void textChanged(DocumentEvent e) {
            validateFields();
        }
    });
    JBLabel bookmarkLabel = new JBLabel("Bookmark name:");
    bookmarkLabel.setLabelFor(myBookmarkName);
    myActiveCheckbox = new JBCheckBox("Inactive", false);
    contentPanel.add(icon, g.nextLine().next().coverColumn(3).pady(DEFAULT_HGAP));
    contentPanel.add(bookmarkLabel, g.next().fillCellNone().insets(new Insets(0, 6, DEFAULT_VGAP, DEFAULT_HGAP)));
    contentPanel.add(myBookmarkName, g.next().coverLine().setDefaultWeightX(1));
    contentPanel.add(myActiveCheckbox, g.nextLine().next().next().coverLine(2));
    return contentPanel;
}
Also used : JBLabel(com.intellij.ui.components.JBLabel) DocumentAdapter(com.intellij.ui.DocumentAdapter) JBTextField(com.intellij.ui.components.JBTextField) GridBag(com.intellij.util.ui.GridBag) DocumentEvent(javax.swing.event.DocumentEvent) JBCheckBox(com.intellij.ui.components.JBCheckBox) NotNull(org.jetbrains.annotations.NotNull)

Example 3 with JBTextField

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

the class PyUniversalTestForm method addCustomOptions.

private void addCustomOptions(@NotNull final CustomOption... customOptions) {
    if (customOptions.length == 0) {
        return;
    }
    final Map<String, JBTextField> optionValueFields = new HashMap<>();
    for (final CustomOption option : customOptions) {
        final JBTextField textField = new JBTextField();
        optionValueFields.put(option.myName, textField);
    }
    myCustomOptionsPanel.setLayout(new GridLayoutManager(customOptions.length, 2));
    for (int i = 0; i < customOptions.length; i++) {
        final CustomOption option = customOptions[i];
        final JBTextField textField = optionValueFields.get(option.myName);
        final GridConstraints labelConstraints = new GridConstraints();
        labelConstraints.setFill(GridConstraints.FILL_VERTICAL);
        labelConstraints.setRow(i);
        labelConstraints.setColumn(0);
        labelConstraints.setHSizePolicy(GridConstraints.SIZEPOLICY_CAN_SHRINK);
        final JLabel label = new JLabel(StringUtil.capitalize(CAPITAL_LETTER.matcher(option.myName).replaceAll(" ")));
        label.setHorizontalAlignment(SwingConstants.LEFT);
        myCustomOptionsPanel.add(label, labelConstraints);
        final GridConstraints textConstraints = new GridConstraints();
        textConstraints.setFill(GridConstraints.FILL_BOTH);
        textConstraints.setRow(i);
        textConstraints.setColumn(1);
        textConstraints.setHSizePolicy(GridConstraints.SIZEPOLICY_CAN_GROW);
        myCustomOptionsPanel.add(textField, textConstraints);
        myCustomOptions.put(option.myName, new OptionHolder(option, label, textField));
    }
}
Also used : GridLayoutManager(com.intellij.uiDesigner.core.GridLayoutManager) GridConstraints(com.intellij.uiDesigner.core.GridConstraints) JBTextField(com.intellij.ui.components.JBTextField)

Example 4 with JBTextField

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

the class SshSettingsPanel method createUIComponents.

private void createUIComponents() {
    myExecutablePathTextField = new JBTextField();
    myExecutablePathField = new TextFieldWithBrowseButton(myExecutablePathTextField);
}
Also used : TextFieldWithBrowseButton(com.intellij.openapi.ui.TextFieldWithBrowseButton) JBTextField(com.intellij.ui.components.JBTextField)

Example 5 with JBTextField

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

the class JreComboboxEditor method createEditorComponent.

@Override
protected JTextField createEditorComponent() {
    JBTextField field = new JBTextField();
    field.setBorder(null);
    return field;
}
Also used : JBTextField(com.intellij.ui.components.JBTextField)

Aggregations

JBTextField (com.intellij.ui.components.JBTextField)23 ComboBox (com.intellij.openapi.ui.ComboBox)7 TextFieldWithBrowseButton (com.intellij.openapi.ui.TextFieldWithBrowseButton)5 JBLabel (com.intellij.ui.components.JBLabel)5 DocumentAdapter (com.intellij.ui.DocumentAdapter)4 JBCheckBox (com.intellij.ui.components.JBCheckBox)4 DocumentEvent (javax.swing.event.DocumentEvent)4 NotNull (org.jetbrains.annotations.NotNull)4 AndroidTargetHash.getAddonHashString (com.android.sdklib.AndroidTargetHash.getAddonHashString)3 BuildFileKey (com.android.tools.idea.gradle.parser.BuildFileKey)3 FileChooserDescriptor (com.intellij.openapi.fileChooser.FileChooserDescriptor)3 GridConstraints (com.intellij.uiDesigner.core.GridConstraints)3 GridLayoutManager (com.intellij.uiDesigner.core.GridLayoutManager)3 ActionEvent (java.awt.event.ActionEvent)3 JLabel (javax.swing.JLabel)3 JPanel (javax.swing.JPanel)3 DialogBuilder (com.intellij.openapi.ui.DialogBuilder)2 JBTable (com.intellij.ui.table.JBTable)2 FormBuilder (com.intellij.util.ui.FormBuilder)2 BorderLayout (java.awt.BorderLayout)2