VirtualFile (Object element) { Object object = element; if (element instanceof AbstractTreeNode) { object = ((AbstractTreeNode<?>)element).getValue(); } return object instanceof PsiDirectory ? ((PsiDirectory)object).getVirtualFile() : object instanceof PsiFile ? ((PsiFile)object).getVirtualFile() : null; }