if (files == null || files.isEmpty()) return;
/**
* Find the importer with the chosen file filter
*/
FileImporter chosenImporter = null;
for (FileImporter importer : ExtensionFileFilter.importers) {
if (fileFilter == importer.filter) {
chosenImporter = importer;
}
}
/**
* If the filter hasn't been changed in the dialog, chosenImporter is null now.
* When the filter has been set explicitly to AllFormatsImporter, treat this the same.
*/
if (chosenImporter instanceof AllFormatsImporter) {
chosenImporter = null;
}
getProgressMonitor().setTicksCount(files.size());
if (chosenImporter != null) {
// The importer was explicitly chosen, so use it.
List<File> filesNotMatchingWithImporter = new LinkedList<>();
List<File> filesMatchingWithImporter = new LinkedList<>();
for (final File f : files) {
if (!chosenImporter.acceptFile(f)) {
if (f.isDirectory()) {
SwingUtilities.invokeLater(new Runnable() {
@Override
public void run() {
JOptionPane.showMessageDialog(Main.parent, tr(