private void setFormatFileFilters(JFileChooser chooser, List<NavigationFormat> formats, String selectedFormat) {
chooser.resetChoosableFileFilters();
FileFilter fileFilter = chooser.getFileFilter();
for (NavigationFormat format : formats) {
NavigationFormatFileFilter navigationFormatFileFilter = new NavigationFormatFileFilter(format);
if (format.getClass().getName().equals(selectedFormat))
fileFilter = navigationFormatFileFilter;
chooser.addChoosableFileFilter(navigationFormatFileFilter);
}
chooser.setFileFilter(fileFilter);