public void fillEntries ( final List < IdAndNamePlusIconBean < T > > pentries ) { this . entries . clear ( ) ; this . radioButtons . clear ( ) ; this . entries . addAll ( pentries ) ; boolean selected = false ; for ( final IdAndNamePlusIconBean < T > entry : this . entries ) { final FlowPanel option = new FlowPanel ( ) ; option . setStylePrimaryName ( this . resource . selectBoxInputStyle ( ) . option ( ) ) ; final RadioButton radioButton = new RadioButton ( ) ; radioButton . getElement ( ) . setId ( this . idBase + entry . getId ( ) ) ; radioButton . setFormValue ( Objects . toString ( entry . getId ( ) ) ) ; radioButton . setName ( this . idBase ) ; if ( ! selected ) { radioButton . setValue ( Boolean . TRUE , false ) ; selected = true ; } radioButton . addClickHandler ( this . clickHandler ) ; option . add ( radioButton ) ; this . radioButtons . add ( radioButton ) ; final SafeHtmlBuilder labelShb = new SafeHtmlBuilder ( ) ; labelShb . appendHtmlConstant ( "<img src=\"" + SafeHtmlUtils . htmlEscape ( entry . getIconUrl ( ) ) + "\" alt=\"" + SafeHtmlUtils . htmlEscape ( entry . getName ( ) ) + "\" />" ) ; labelShb . appendEscaped ( entry . getName ( ) ) ; final InputLabel label = new InputLabel ( ) ; label . setFor ( radioButton ) ; label . setHtml ( labelShb . toSafeHtml ( ) ) ; option . add ( label ) ; this . options . add ( option ) ; } }
fill entries for the select box .