public static boolean hasVisibleChildren(ActionGroup group,PresentationFactory factory,ActionManager actionManager,PerspectiveManager perspectiveManager){
  ActionEvent event=new ActionEvent(factory.getPresentation(group),actionManager,perspectiveManager);
  for (  Action anAction : group.getChildren(event)) {
    if (anAction == null) {
      Log.error(Utils.class,"Null action found in group " + group + ", "+ factory.getPresentation(group));
      continue;
    }
    if (anAction instanceof Separator) {
      continue;
    }
    final Presentation presentation=factory.getPresentation(anAction);
    anAction.update(new ActionEvent(presentation,actionManager,perspectiveManager));
    if (anAction instanceof ActionGroup) {
      ActionGroup childGroup=(ActionGroup)anAction;
      if (childGroup.isPopup()) {
        if (!presentation.isVisible()) {
          continue;
        }
      }
      if (hasVisibleChildren(childGroup,factory,actionManager,perspectiveManager)) {
        return true;
      }
    }
 else     if (presentation.isVisible()) {
      return true;
    }
  }
  return false;
}

public static boolean hasVisibleChildren ( ActionGroup group , PresentationFactory factory , ActionManager actionManager , PerspectiveManager perspectiveManager ) { ActionEvent event = new ActionEvent ( factory . getPresentation ( group ) , actionManager , perspectiveManager ) ; for ( Action anAction : group . getChildren ( event ) ) { if ( anAction == null ) { Log . error ( Utils . class , "Null action found in group " + group + ", " + factory . getPresentation ( group ) ) ; continue ; } if ( anAction instanceof Separator ) { continue ; } final Presentation presentation = factory . getPresentation ( anAction ) ; anAction . update ( new ActionEvent ( presentation , actionManager , perspectiveManager ) ) ; if ( anAction instanceof ActionGroup ) { ActionGroup childGroup = ( ActionGroup ) anAction ; if ( childGroup . isPopup ( ) ) { if ( ! presentation . isVisible ( ) ) { continue ; } } if ( hasVisibleChildren ( childGroup , factory , actionManager , perspectiveManager ) ) { return true ; } } else if ( presentation . isVisible ( ) ) { return true ; } } return false ; }
returns true if action group has visible children .
