PsiDirectory (@NotNull IdeView view) { PsiDirectory[] dirs = view.getDirectories(); if (dirs.length == 0) return null; if (dirs.length == 1) { return dirs[0]; } else { Project project = dirs[0].getProject(); return selectDirectory(project, dirs, null, ""); } }