private static void hideWhenChildrenIsInvisible(JComponent component) {
    Component[] children = component.getComponents();
    component.setVisible(ContainerUtil.exists(children, it -> it.isVisible()));
    for (var child : children) {
      UIUtil.runWhenVisibilityChanged(child, () -> component.setVisible(ContainerUtil.exists(children, it -> it.isVisible())));
    }
  }
private static void hideWhenChildrenIsInvisible(JComponent component)