Search in sources :

Example 6 with ComponentWithBrowseButton

use of com.intellij.openapi.ui.ComponentWithBrowseButton 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)

Aggregations

ComponentWithBrowseButton (com.intellij.openapi.ui.ComponentWithBrowseButton)6 FileChooserDescriptor (com.intellij.openapi.fileChooser.FileChooserDescriptor)3 TextBrowseFolderListener (com.intellij.openapi.ui.TextBrowseFolderListener)3 TextFieldWithBrowseButton (com.intellij.openapi.ui.TextFieldWithBrowseButton)3 CompilerOptionInfo (com.intellij.flex.model.bc.CompilerOptionInfo)1 ValueSource (com.intellij.flex.model.bc.ValueSource)1 ComboBox (com.intellij.openapi.ui.ComboBox)1 TextFieldWithHistory (com.intellij.ui.TextFieldWithHistory)1 JBLabel (com.intellij.ui.components.JBLabel)1 ActionEvent (java.awt.event.ActionEvent)1 ActionListener (java.awt.event.ActionListener)1 File (java.io.File)1 ArrayList (java.util.ArrayList)1 TableCellRenderer (javax.swing.table.TableCellRenderer)1 Nls (org.jetbrains.annotations.Nls)1 TemplateResource (org.jetbrains.java.generate.template.TemplateResource)1 TemplatesPanel (org.jetbrains.java.generate.view.TemplatesPanel)1