Groovy Swing Recurse Components
Groovy Swing Recurse Components
Copy this code and paste it in your HTML
def recurseComp
( aComp, results
= [] ) { if ( (aComp
!= null) && !(aComp
in results
) ) { results << aComp;
if ( aComp.
properties.
components ) { recurseComp( it, results );
}
}
}
}
def recurseCompByLevel
( aComp, results
= [], levels
= [] ) { if ( (aComp
!= null) && !(aComp
in results
) ) { results << aComp;
if ( aComp.
properties.
components ) {
levels
<< aComp.
components.
collect { it
};
recurseCompByLevel( it, results, levels );
}
}
}
}
Report this snippet
Comments
Subscribe to comments