GradleModuleDirectoryNode (@NotNull Project project, @NotNull PsiDirectoryNode directoryNode, ViewSettings settings) { PsiDirectory psiDirectory = directoryNode.getValue(); if (psiDirectory == null) return null; final VirtualFile virtualFile = psiDirectory.getVirtualFile(); if (!ProjectRootsUtil.isModuleContentRoot(virtualFile, project)) return null; ProjectFileIndex fileIndex = ProjectRootManager.getInstance(project).getFileIndex(); final Module module = fileIndex.getModuleForFile(virtualFile); final String moduleShortName = getGradleModuleShortName(module); if (moduleShortName == null) return null; return new GradleModuleDirectoryNode(project, psiDirectory, settings, module, moduleShortName, directoryNode.getFilter()); }