protected void alertFilesWithUnknownImporter(Collection<File> files) { final StringBuffer msg = new StringBuffer(); msg.append("<html>"); msg.append( trn( "Cannot open {0} file because file does not exist or no suitable file importer is available.", "Cannot open {0} files because files do not exist or no suitable file importer is available.", files.size(), files.size())) .append("<br>"); msg.append("<ul>"); for (File f : files) { msg.append("<li>"); msg.append(f.getAbsolutePath()); msg.append(" (<i>"); msg.append(f.exists() ? tr("no importer") : tr("does not exist")); msg.append("</i>)</li>"); } msg.append("</ul>"); HelpAwareOptionPane.showMessageDialogInEDT( Main.parent, msg.toString(), tr("Warning"), JOptionPane.WARNING_MESSAGE, HelpUtil.ht("/Action/Open#MissingImporterForFiles")); }
protected void alertFilesNotMatchingWithImporter( Collection<File> files, FileImporter importer) { final StringBuffer msg = new StringBuffer(); msg.append("<html>"); msg.append( trn( "Cannot open {0} file with the file importer ''{1}''.", "Cannot open {0} files with the file importer ''{1}''.", files.size(), files.size(), importer.filter.getDescription())) .append("<br>"); msg.append("<ul>"); for (File f : files) { msg.append("<li>").append(f.getAbsolutePath()).append("</li>"); } msg.append("</ul>"); HelpAwareOptionPane.showMessageDialogInEDT( Main.parent, msg.toString(), tr("Warning"), JOptionPane.WARNING_MESSAGE, HelpUtil.ht("/Action/Open#ImporterCantImportFiles")); }