kaikramer / keystore-explorer

KeyStore Explorer is a free GUI replacement for the Java command-line utilities keytool and jarsigner.
https://keystore-explorer.org/
GNU General Public License v3.0
1.7k stars 275 forks source link

Updated JavaFXFileChooser to include setSelectedExtensionFilter #386

Closed Colbix closed 2 years ago

Colbix commented 2 years ago

Moved repetitive loops into their own respective functions added setSelectedExensionFilter function

Colbix commented 2 years ago

I am going to decouple the function extensionFilterFormat to have a list array as an argument. Currently the function is hard coded to loop through the filters list array.

Edit: I'm aware of the import of a Java FX class, must have accidently clicked import at some point. I'll update once have a chance.

Colbix commented 2 years ago

Ok, I think I'm done. Tested with various setFileFilter configurations, with/without all files, and no extensions. If there is anything else you can think of please let me know.

Once this good then I'll also update the FileChooserFactory to setFileFilter. For multiple extensions I'm looking at selecting the first in alphabetical order unless you have another idea.

kaikramer commented 2 years ago

There are some issues with formatting (indentation, spaces before/after brackets, line breaks), but I think it's easier and faster if I just run the formatter over the code after merging.

Thanks for your contribution, appreciated!

Once this good then I'll also update the FileChooserFactory to setFileFilter. For multiple extensions I'm looking at selecting the first in alphabetical order unless you have another idea.

Yeah, alphabetical order seems fine.