@Override
  public void update(@NotNull AnActionEvent e) {
    DataContext ctx = e.getDataContext();
    IdeView view = LangDataKeys.IDE_VIEW.getData(ctx);
    PsiDirectory target = view != null && e.getProject() != null ? getTargetDirectory(ctx, view) : null;
    if (target == null || !PsiUtil.isAvailable(JavaFeature.MODULES, target)) {
      e.getPresentation().setEnabledAndVisible(false);
    }
    else {
      e.getPresentation().setVisible(true);
      e.getPresentation().setEnabled(JavaModuleGraphUtil.findDescriptorByElement(target) == null);
    }
  }
@Override
  public void update(@NotNull AnActionEvent e)