public static List < ComponentWithContext > collateVisibles ( final WComponent comp ) { final List < ComponentWithContext > list = new ArrayList <> ( ) ; WComponentTreeVisitor visitor = new WComponentTreeVisitor ( ) { @ Override public VisitorResult visit ( final WComponent comp ) { // In traversing the tree, special components like WInvisbleContainer, WRepeatRoot are still traversed // (so ignore them) if ( comp . isVisible ( ) ) { list . add ( new ComponentWithContext ( comp , UIContextHolder . getCurrent ( ) ) ) ; } return VisitorResult . CONTINUE ; } } ; traverseVisible ( comp , visitor ) ; return list ; }
Obtains a list of components which are visible in the given tree . Repeated components will be returned multiple times one for each row which they are visible in .