Search in sources :

Example 56 with TextFieldWithBrowseButton

use of com.intellij.openapi.ui.TextFieldWithBrowseButton in project ballerina by ballerina-lang.

the class BallerinaRunUtil method installWorkingDirectoryChooser.

private static void installWorkingDirectoryChooser(@NotNull Project project, @NotNull ComponentWithBrowseButton field) {
    FileChooserDescriptor chooseDirectoryDescriptor = FileChooserDescriptorFactory.createSingleFolderDescriptor();
    chooseDirectoryDescriptor.setShowFileSystemRoots(true);
    chooseDirectoryDescriptor.withShowHiddenFiles(false);
    if (field instanceof TextFieldWithBrowseButton) {
        ((TextFieldWithBrowseButton) field).addBrowseFolderListener(new TextBrowseFolderListener(chooseDirectoryDescriptor, project));
    } else {
        // noinspection unchecked
        field.addBrowseFolderListener(project, new ComponentWithBrowseButton.BrowseFolderActionListener(null, null, field, project, chooseDirectoryDescriptor, TextComponentAccessor.TEXT_FIELD_WITH_HISTORY_WHOLE_TEXT));
    }
}
Also used : TextFieldWithBrowseButton(com.intellij.openapi.ui.TextFieldWithBrowseButton) FileChooserDescriptor(com.intellij.openapi.fileChooser.FileChooserDescriptor) ComponentWithBrowseButton(com.intellij.openapi.ui.ComponentWithBrowseButton) TextBrowseFolderListener(com.intellij.openapi.ui.TextBrowseFolderListener)

Example 57 with TextFieldWithBrowseButton

use of com.intellij.openapi.ui.TextFieldWithBrowseButton in project ballerina by ballerina-lang.

the class BallerinaApplicationSettingsEditor method createUIComponents.

private void createUIComponents() {
    myRunKindComboBox = new LabeledComponent<>();
    myRunKindComboBox.setComponent(new JComboBox<>());
    myFileField = new LabeledComponent<>();
    myFileField.setComponent(new TextFieldWithBrowseButton());
    myPackageField = new LabeledComponent<>();
    myPackageField.setComponent(new BallerinaPackageFieldCompletionProvider(() -> myModulesComboBox.getComponent().getSelectedModule()).createEditor(myProject));
    myWorkingDirectoryField = new LabeledComponent<>();
    myWorkingDirectoryField.setComponent(new TextFieldWithBrowseButton());
    myParamsField = new LabeledComponent<>();
    myParamsField.setComponent(new RawCommandLineEditor());
    myBallerinaParamsField = new LabeledComponent<>();
    myBallerinaParamsField.setComponent(new RawCommandLineEditor());
    myModulesComboBox = new LabeledComponent<>();
    myModulesComboBox.setComponent(new ModulesComboBox());
}
Also used : ModulesComboBox(com.intellij.application.options.ModulesComboBox) TextFieldWithBrowseButton(com.intellij.openapi.ui.TextFieldWithBrowseButton) RawCommandLineEditor(com.intellij.ui.RawCommandLineEditor)

Example 58 with TextFieldWithBrowseButton

use of com.intellij.openapi.ui.TextFieldWithBrowseButton in project ballerina by ballerina-lang.

the class BallerinaTestSettingsEditor method createUIComponents.

private void createUIComponents() {
    myFileField = new LabeledComponent<>();
    myFileField.setComponent(new TextFieldWithBrowseButton());
    myPackageField = new LabeledComponent<>();
    myPackageField.setComponent(new BallerinaPackageFieldCompletionProvider(() -> myModulesComboBox.getComponent().getSelectedModule()).createEditor(myProject));
    myWorkingDirectoryField = new LabeledComponent<>();
    myWorkingDirectoryField.setComponent(new TextFieldWithBrowseButton());
    myParamsField = new LabeledComponent<>();
    myParamsField.setComponent(new RawCommandLineEditor());
    myModulesComboBox = new LabeledComponent<>();
    myModulesComboBox.setComponent(new ModulesComboBox());
}
Also used : ModulesComboBox(com.intellij.application.options.ModulesComboBox) TextFieldWithBrowseButton(com.intellij.openapi.ui.TextFieldWithBrowseButton) RawCommandLineEditor(com.intellij.ui.RawCommandLineEditor)

Example 59 with TextFieldWithBrowseButton

use of com.intellij.openapi.ui.TextFieldWithBrowseButton in project intellij-plugins by StepicOrg.

the class StepikPyProjectGenerator method setLocation.

private void setLocation(@NotNull String location) {
    if (keepLocation) {
        return;
    }
    TextFieldWithBrowseButton locationField = getLocationField();
    if (locationField == null) {
        return;
    }
    locationSetting = true;
    locationField.setText(location);
    locationSetting = false;
}
Also used : TextFieldWithBrowseButton(com.intellij.openapi.ui.TextFieldWithBrowseButton)

Aggregations

TextFieldWithBrowseButton (com.intellij.openapi.ui.TextFieldWithBrowseButton)59 FileChooserDescriptor (com.intellij.openapi.fileChooser.FileChooserDescriptor)22 NotNull (org.jetbrains.annotations.NotNull)12 VirtualFile (com.intellij.openapi.vfs.VirtualFile)9 ActionEvent (java.awt.event.ActionEvent)9 ActionListener (java.awt.event.ActionListener)8 JBLabel (com.intellij.ui.components.JBLabel)6 JBTextField (com.intellij.ui.components.JBTextField)6 DocumentEvent (javax.swing.event.DocumentEvent)6 File (java.io.File)5 Nullable (org.jetbrains.annotations.Nullable)5 FileTextField (com.intellij.openapi.fileChooser.FileTextField)4 ComboBox (com.intellij.openapi.ui.ComboBox)4 TextBrowseFolderListener (com.intellij.openapi.ui.TextBrowseFolderListener)4 DocumentListener (javax.swing.event.DocumentListener)4 AndroidTargetHash.getAddonHashString (com.android.sdklib.AndroidTargetHash.getAddonHashString)3 BuildFileKey (com.android.tools.idea.gradle.parser.BuildFileKey)3 ComponentWithBrowseButton (com.intellij.openapi.ui.ComponentWithBrowseButton)3 RawCommandLineEditor (com.intellij.ui.RawCommandLineEditor)3 JBCheckBox (com.intellij.ui.components.JBCheckBox)3