2

I have an SWT FileDialog (style: SWT.OPEN) with multiple filters each with multiple file extensions. I want to include an "All known formats" filter with every file extension the application recognizes. This list is very long and will not fit on-screen. On Mac, the FileDialog sizes the filter combo box the width of the widest filter string. The control is not easily usable because the string is too wide to fit on-screen and the text is centered so you cannot read the filter description at the beginning.

Can I hide the file extensions in the FileDialog filter combo box drawn on-screen but still associate the extensions with the filter? Does anyone have alternate suggestions?

Screenshots of problem

All known formats filter on Mac Available filters for files recognized by the application

Steven Darnell
  • 339
  • 1
  • 11

1 Answers1

0

FileDialog requires that you provide a list of descriptions and a list of extensions to define a set of filters. I overlooked the fact that my code concatenated the descriptor and the extension list to make a more descriptive label. This was done at a time when the number of supported file types was small. The answer is to provide a condition where the extension list is not appended to the description "All known formats." That's embarrassing...

Thank you to those who responded.

Steven Darnell
  • 339
  • 1
  • 11