public static JQMCollapsible isCollapsibleHeaderChild(Widget w) {
        if (w == null) return null;
        List<Widget> parentChain = null;
        w = w.getParent();
        while (w != null) {
            if (w instanceof JQMCollapsible) {
                JQMCollapsible co = (JQMCollapsible) w;
                if (co.headerPanel != null && parentChain != null && parentChain.contains(co.headerPanel)) {
                    return co;
                } else {
                    return null;
                }
            }
            if (parentChain == null) parentChain = new ArrayList<>();
            parentChain.add(w);
            w = w.getParent();
        }
        return null;
    }
public static JQMCollapsible isCollapsibleHeaderChild ( Widget w ) { if ( w == null ) return null ; List < Widget > parentChain = null ; w = w . getParent ( ) ; while ( w != null ) { if ( w instanceof JQMCollapsible ) { JQMCollapsible co = ( JQMCollapsible ) w ; if ( co . headerPanel != null && parentChain != null && parentChain . contains ( co . headerPanel ) ) { return co ; } else { return null ; } } if ( parentChain == null ) parentChain = new ArrayList < > ( ) ; parentChain . add ( w ) ; w = w . getParent ( ) ; } return null ; }
@return - if widget is child of some collapsible's header then returns that collapsible, otherwise null