void (List<String> problems) { boolean more = false; if (problems.size() > 10) { problems = problems.subList(0, 10); more = true; } Messages.showMessageDialog( IdeBundle.message("dialog.message.could.not.erase.files.or.folders.0.1", StringUtil.join(problems, ",\n "), more ? "\n ..." : ""), UIBundle.message("error.dialog.title"), Messages.getErrorIcon()); }