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