private void fillEntries ( final Collection < T > pids ) { this . entries . clear ( ) ; final Stream < IdAndNameBean < T > > stream = pids . stream ( ) . map ( proEnum -> new IdAndNameBean <> ( proEnum , this . messages . name ( proEnum ) ) ) ; final Stream < IdAndNameBean < T > > sortedStream ; if ( this . sortOrder == null ) { sortedStream = stream ; } else { switch ( this . sortOrder == null ? null : this . sortOrder ) { case ID_ASC : sortedStream = stream . sorted ( new IdAndNameIdComperator < T > ( ) ) ; break ; case ID_DSC : sortedStream = stream . sorted ( Collections . reverseOrder ( new IdAndNameIdComperator < T > ( ) ) ) ; break ; case NAME_ASC : sortedStream = stream . sorted ( new IdAndNameNameComperator < T > ( ) ) ; break ; case NAME_DSC : sortedStream = stream . sorted ( Collections . reverseOrder ( new IdAndNameNameComperator < T > ( ) ) ) ; break ; default : sortedStream = stream ; break ; } } this . entries . addAll ( sortedStream . collect ( Collectors . toList ( ) ) ) ; this . flowPanel . clear ( ) ; this . entries . forEach ( entry -> { final RadioButton radioButton = new RadioButton ( this . widgetId , entry . getName ( ) ) ; radioButton . setFormValue ( Objects . toString ( entry . getId ( ) ) ) ; radioButton . setEnabled ( this . enabled ) ; this . flowPanel . add ( radioButton ) ; this . idToButtonMap . put ( entry . getId ( ) , radioButton ) ; } ) ; }
fill entries of the radio buttons .