private static void addPsiElementNode(PsiElement psiElement,
                                        final Project project,
                                        final ArrayList<? super AbstractTreeNode<?>> result,
                                        @NotNull ViewSettings favoritesConfig) {

    Class<? extends AbstractTreeNode<?>> klass = getPsiElementNodeClass(psiElement);
    if (klass == null) {
      psiElement = PsiTreeUtil.getParentOfType(psiElement, PsiFile.class);
      if (psiElement != null) {
        klass = PsiFileNode.class;
      }
    }

    final Object value = psiElement;
    try {
      if (klass != null && value != null) {
        result.add(ProjectViewNode.createTreeNode(klass, project, value, favoritesConfig));
      }
    }
    catch (Exception e) {
      LOG.error(e);
    }
  }
private static void addPsiElementNode(PsiElement psiElement,
                                        final Project project,
                                        final ArrayList<? super AbstractTreeNode<?>> result,
                                        @NotNull ViewSettings favoritesConfig)