private ExampleData getMatch ( final WComponent node , final String name , final boolean partial ) { if ( node instanceof WMenuItem ) { ExampleData data = ( ExampleData ) ( ( WMenuItem ) node ) . getActionObject ( ) ; Class < ? extends WComponent > clazz = data . getExampleClass ( ) ; if ( clazz . getName ( ) . equals ( name ) || data . getExampleName ( ) . equals ( name ) || ( partial && clazz . getSimpleName ( ) . toLowerCase ( ) . contains ( name . toLowerCase ( ) ) ) || ( partial && data . getExampleName ( ) . toLowerCase ( ) . contains ( name . toLowerCase ( ) ) ) ) { return data ; } } else if ( node instanceof Container ) { for ( int i = 0 ; i < ( ( Container ) node ) . getChildCount ( ) ; i ++ ) { ExampleData result = getMatch ( ( ( Container ) node ) . getChildAt ( i ) , name , partial ) ; if ( result != null ) { return result ; } } } return null ; }
Recursively searches the menu for a match to a WComponent with the given name .