Example usage for com.intellij.openapi.ui TextFieldWithBrowseButton addBrowseFolderListener

List of usage examples for com.intellij.openapi.ui TextFieldWithBrowseButton addBrowseFolderListener

Introduction

In this page you can find the example usage for com.intellij.openapi.ui TextFieldWithBrowseButton addBrowseFolderListener.

Prototype

public void addBrowseFolderListener(@Nullable @Nls(capitalization = Nls.Capitalization.Title) String title,
            @Nullable @Nls(capitalization = Nls.Capitalization.Sentence) String description,
            @Nullable Project project, FileChooserDescriptor fileChooserDescriptor) 

Source Link

Usage

From source file:org.jetbrains.plugins.ruby.ruby.run.confuguration.RubyRunConfigurationUIUtil.java

License:Apache License

public static FileChooserDescriptor addFolderChooser(@NotNull final String title,
        @NotNull final TextFieldWithBrowseButton textField, final Project project) {
    final FileChooserDescriptor folderChooserDescriptor = FileChooserDescriptorFactory
            .createSingleFolderDescriptor();
    folderChooserDescriptor.setTitle(title);
    textField.addBrowseFolderListener(title, null, project, folderChooserDescriptor);
    return folderChooserDescriptor;
}

From source file:org.jetbrains.plugins.ruby.ruby.run.confuguration.RubyRunConfigurationUIUtil.java

License:Apache License

public static FileChooserDescriptor addFileChooser(@NotNull final String title,
        @NotNull final TextFieldWithBrowseButton textField, @Nullable final Project project) {
    final FileChooserDescriptor fileChooserDescriptor = FileChooserDescriptorFactory
            .createSingleFileNoJarsDescriptor();
    fileChooserDescriptor.setTitle(title);
    textField.addBrowseFolderListener(title, null, project, fileChooserDescriptor);
    return fileChooserDescriptor;
}

From source file:org.twodividedbyzero.idea.findbugs.gui.settings.ShareTab.java

License:Open Source License

ShareTab(@NotNull final Project project, @Nullable final Module module) {
    super(new VerticalFlowLayout(HAlignment.Left, VAlignment.Top, 0, 0, true, false));
    this.project = project;
    importFilePathKey = module != null ? module.getName() : WorkspaceSettings.PROJECT_IMPORT_FILE_PATH_KEY;

    description = new JLabel("<html>" + ResourcesLoader.getString("share.description"));
    description.setBorder(BorderFactory.createEmptyBorder(5, 5, 0, 5));
    description.setIcon(MessageType.INFO.getDefaultIcon());
    description.setDisabledIcon(MessageType.INFO.getDefaultIcon());

    final String url = ResourcesLoader.getString("share.url");
    link = new HyperlinkLabel(); // LATER: HotspotPainter (Search) does not work with HyperlinkLabel
    link.setHyperlinkText(url);/*from ww w  .  ja v a  2 s .c  om*/
    link.setHyperlinkTarget(url);

    final JPanel linkPane = new JPanel(
            new FlowLayout(FlowLayout.LEFT, MessageType.INFO.getDefaultIcon().getIconWidth() + 5, 0));
    linkPane.add(link);

    final FileChooserDescriptor descriptor = FileChooserDescriptorFactory
            .createSingleFileDescriptor(XmlFileType.INSTANCE);
    final FileTextField field = FileChooserFactory.getInstance().createFileTextField(descriptor, this);
    final TextFieldWithBrowseButton importPath = new TextFieldWithBrowseButton(field.getField());
    importPath.addBrowseFolderListener(ResourcesLoader.getString("settings.choose.title"),
            ResourcesLoader.getString("settings.choose.description"), null, descriptor);
    importPathLabel = new LabeledComponent<TextFieldWithBrowseButton>();
    importPathLabel.setBorder(BorderFactory.createEmptyBorder(5, 0, 0, 0));
    importPathLabel.setComponent(importPath);
    importPathLabel.setLabelLocation(BorderLayout.WEST);
    importPathLabel.setText(ResourcesLoader.getString("share.file.title"));

    add(description);
    add(linkPane);
    add(importPathLabel);
}