List<File> () { Object o = myModel.get(index); if (o instanceof PsiElement) { VirtualFile vf = o instanceof PsiDirectory ? ((PsiDirectory)o).getVirtualFile() : ((PsiElement)o).getContainingFile().getVirtualFile(); if (vf != null) { return Collections.singletonList(new File(vf.getPath()).getAbsoluteFile()); } } return Collections.emptyList(); }