B4J Library File Chooser Utils

I had thought there was something unusual about the FileChooser for a while, last night it dawned on me that it is not possible to select a specific file type from the list.

I have created a Utils module to allow this.

There are 4 options (only to save typing when setting it up) that allow entering individual file extensions that then are individually selectable, you have to enter a description for each file extension, you can also add a merged filter (with a separate name) this is what we have now, and a further option to add an all files filter, and an option for both.

There is also a method to set the initially selected filter.

It's a static module, so you need to pass a FileChooser object to each call.

You can compile it to a library if you don't want to add the module to a project.

Hope you find it useful.
 

Attachments

  • FileChooserUtils.zip
    2 KB · Views: 1,131
Last edited:

rgarnett1955

Active Member
Licensed User
Longtime User
I had thought there was something unusual about the FileChooser for a while, last night it dawned on me that it is not possible to select a specific file type from the list.

I have created a Utils module to allow this.

There are 4 options (only to save typing when setting it up) that allow entering individual file extensions that then are individually selectable, you have to enter a description for each file extension, you can also add a merged filter (with a separate name) this is what we have now, and a further option to add an all files filter, and an option for both.

There is also a method to set the initially selected filter.

It's a static module, so you need to pass a FileChooser object to each call.

You can compile it to a library if you don't want to add the module to a project.

Hope you find it useful.

Hi

Very nice code.

I am making a file chooser custom view with previous files list/search. I have incorporated your code into it.

I will publish the finished product soon.

Best regards
Rob
 
Top