Search in sources :

Example 1 with MMDFile

use of com.igormaznitsa.ideamindmap.lang.MMDFile in project netbeans-mmd-plugin by raydac.

the class IdeaUtils method findPsiFileLinksForProjectScope.

public static List<PsiExtraFile> findPsiFileLinksForProjectScope(final Project project) {
    List<PsiExtraFile> result = new ArrayList<PsiExtraFile>();
    Collection<VirtualFile> virtualFiles = FileBasedIndex.getInstance().getContainingFiles(FileTypeIndex.NAME, MindMapFileType.INSTANCE, GlobalSearchScope.allScope(project));
    for (VirtualFile virtualFile : virtualFiles) {
        final MMDFile simpleFile = (MMDFile) PsiManager.getInstance(project).findFile(virtualFile);
        if (simpleFile != null) {
            final PsiExtraFile[] fileLinks = PsiTreeUtil.getChildrenOfType(simpleFile, PsiExtraFile.class);
            if (fileLinks != null) {
                Collections.addAll(result, fileLinks);
            }
        }
    }
    return result;
}
Also used : VirtualFile(com.intellij.openapi.vfs.VirtualFile) MMDFile(com.igormaznitsa.ideamindmap.lang.MMDFile) PsiExtraFile(com.igormaznitsa.ideamindmap.lang.psi.PsiExtraFile)

Aggregations

MMDFile (com.igormaznitsa.ideamindmap.lang.MMDFile)1 PsiExtraFile (com.igormaznitsa.ideamindmap.lang.psi.PsiExtraFile)1 VirtualFile (com.intellij.openapi.vfs.VirtualFile)1