List<VirtualFile> (@NotNull AnActionEvent e) { final Project project = getEventProject(e); final VirtualFile[] files = e.getData(CommonDataKeys.VIRTUAL_FILE_ARRAY); if (project == null || files == null || files.length == 0) return Collections.emptyList(); List<VirtualFile> roots = new ArrayList<>(); for (VirtualFile file : files) { if (file.isDirectory()) { roots.add(file); } else { final VirtualFile root = JarFileSystem.getInstance().getJarRootForLocalFile(file); if (root != null) { roots.add(root); } } } return roots; }