void () { List<Path> paths = myPanel.chosenPaths(); if (paths.isEmpty()) { Messages.showWarningDialog(myPanel, UIBundle.message("file.chooser.nothing.selected"), getTitle()); return; } var results = new ArrayList<VirtualFile>(); var misses = new ArrayList<@NlsSafe String>(); for (Path path : paths) { var file = toVirtualFile(path); var adjusted = file != null && file.isValid() ? myDescriptor.getFileToSelect(file) : null; if (adjusted != null) { results.add(adjusted); } else { misses.add(path.toUri().toString()); } } if (!misses.isEmpty()) { var urls = misses.stream().map(s -> "&nbsp;&nbsp;&nbsp;" + s).collect(Collectors.joining("<br>")); var message = UIBundle.message("file.chooser.vfs.lookup", urls); Messages.showErrorDialog(myPanel, message, getTitle()); return; } try { myDescriptor.validateSelectedFiles(VfsUtilCore.toVirtualFileArray(results)); } catch (Exception e) { Messages.showErrorDialog(myPanel, e.getMessage(), getTitle()); return; } myResults = results; FileChooserUtil.updateRecentPaths(myProject, results.get(0)); super.doOKAction(); }