private static Class<? extends AbstractTreeNode<?>> getPsiElementNodeClass(PsiElement psiElement) {
    Class<? extends AbstractTreeNode<?>> klass = null;
    if (psiElement instanceof PsiFile) {
      klass = PsiFileNode.class;
    }
    else if (psiElement instanceof PsiDirectory) {
      klass = PsiDirectoryNode.class;
    }
    return klass;
  }
private static Class<? extends AbstractTreeNode<?>> getPsiElementNodeClass(PsiElement psiElement)