public void selectExample ( final ExampleData example ) { try { StringBuilder exampleName = new StringBuilder ( ) ; if ( example . getExampleGroupName ( ) != null && ! example . getExampleGroupName ( ) . equals ( "" ) ) { exampleName . append ( example . getExampleGroupName ( ) ) . append ( " - " ) ; } exampleName . append ( example . getExampleName ( ) ) ; selectExample ( example . getExampleClass ( ) . newInstance ( ) , exampleName . toString ( ) ) ; } catch ( Exception e ) { WMessages . getInstance ( this ) . error ( "Error selecting example \"" + example . getExampleName ( ) + ' ' ) ; selectExample ( new ErrorComponent ( e . getMessage ( ) , e ) , "Error" ) ; } }
Selects an example . If there is an error instantiating the component an error message will be displayed .