Pivot
  1. Pivot
  2. PIVOT-492

Unable to select a file and/or a directory in FileBrowserSheet

    Details

      Description

      Hi,
      I'm writing a file chooser now with FileBrowserSheet. I found that I can only select a file when the mode is SAVE_AS and a directory when the mode is SAVE_TO.

      I would like a mode in which I can select either a file or a directory. I find no way to realize this. Please help.

      The function shoule be something like what Swing JFileChoose does below:

      JFileChooser chooser = new JFileChooser();
      ...
      chooser.setFileSelectionMode(JFileChooser.FILES_AND_DIRECTORIES);
      int returnVal = chooser.showOpenDialog(this);

      My use case is like this. I am writing a tool which can do some conversion tasks for files. If user selects a file via FileBrowserSheet, the tool will just deal with the selected file. However, if the user selects a folder, the tool will scan and convert all files or filtered files under this folder recursively. This will make the tool look smarter.

      1. FileBrowserSheet.diff
        0.9 kB
        Wenguang Liu
      2. src.java.zip
        5 kB
        Wenguang Liu
      3. TerraFileBrowserSheetSkin.diff
        2 kB
        Wenguang Liu

        Activity

        Hide
        Greg Brown added a comment -

        This is most likely best implemented as an extension to the OPEN and OPEN_MULTIPLE modes.

        Show
        Greg Brown added a comment - This is most likely best implemented as an extension to the OPEN and OPEN_MULTIPLE modes.
        Hide
        Wenguang Liu added a comment -

        I tried to implement two new modes:

        • OPEN_DIR : user can choose one single directory
        • OPEN_MULTIPLE_ANY : user can choose multiple directories and files

        Hope this can help.

        Show
        Wenguang Liu added a comment - I tried to implement two new modes: OPEN_DIR : user can choose one single directory OPEN_MULTIPLE_ANY : user can choose multiple directories and files Hope this can help.

          People

          • Assignee:
            Roger Whitcomb
            Reporter:
            David Gao
          • Votes:
            1 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

            • Created:
              Updated:

              Development