void (final VirtualFile[] files) { if (files.length == 0) { return; } ApplicationManager.getApplication().invokeLater(() -> { final AntConfiguration antConfiguration = myConfig; if (antConfiguration == null) { return; } final List<VirtualFile> ignoredFiles = new ArrayList<>(); for (VirtualFile file : files) { try { antConfiguration.addBuildFile(file); } catch (AntNoFileException e) { ignoredFiles.add(e.getFile()); } } if (ignoredFiles.size() != 0) { String messageText; @NlsSafe final StringBuilder message = new StringBuilder(); String separator = ""; for (final VirtualFile virtualFile : ignoredFiles) { message.append(separator); message.append(virtualFile.getPresentableUrl()); separator = "\n"; } messageText = message.toString(); Messages.showWarningDialog(myProject, messageText, AntBundle.message("cannot.add.ant.files.dialog.title")); } }); }