@Override
  public void update(@NotNull AnActionEvent e) {
    final PsiElement[] elements = e.getData(PlatformCoreDataKeys.PSI_ELEMENT_ARRAY);
    if (ActionPlaces.isPopupPlace(e.getPlace())) {
      e.getPresentation().setEnabledAndVisible(isAllDirectories(elements));
    }
    else {
      e.getPresentation().setEnabled(isAllDirectories(elements));
    }
  }
@Override
  public void update(@NotNull AnActionEvent e)