@Override
  public void update(@NotNull AnActionEvent e) {
    ProjectStructureElement element = e.getUpdateSession()
      .compute(this, "getSelection", ActionUpdateThread.EDT, () -> myConfigurable.getSelectedElement());
    boolean visible = false;
    if (element instanceof LibraryProjectStructureElement) {
      final LibraryEx library = (LibraryEx)((LibraryProjectStructureElement)element).getLibrary();
      visible = !LibraryEditingUtil.getSuitableModules(myConfigurable.getProjectStructureConfigurable().getModulesConfig(), library.getKind(), library).isEmpty();
    }
    e.getPresentation().setVisible(visible);
  }
@Override
  public void update(@NotNull AnActionEvent e)