protected String [ ] getColumnClasses ( PanelGrid panelGrid , int [ ] colSpans ) { String columnsCSV = panelGrid . getColumnClasses ( ) ; String [ ] columnClasses ; if ( null == columnsCSV || columnsCSV . trim ( ) . length ( ) == 0 ) columnClasses = null ; else { columnClasses = columnsCSV . split ( "," ) ; if ( columnClasses . length > colSpans . length ) { throw new FacesException ( "PanelGrid: You defined more columnClasses than columns or colSpans" ) ; } } String size = panelGrid . getSize ( ) ; if ( null == size || size . trim ( ) . equals ( "" ) ) { size = "lg" ; } else { size = Responsive . translateSize ( size , true ) ; } String [ ] result = new String [ colSpans . length ] ; for ( int i = 0 ; i < colSpans . length ; i ++ ) { if ( columnClasses == null ) { result [ i ] = "col-" + size + "-" + colSpans [ i ] ; } else { String current = columnClasses [ i % columnClasses . length ] ; if ( current . contains ( "col-" ) ) { result [ i ] = current ; } else { result [ i ] = "col-" + size + "-" + colSpans [ i ] + " " + current ; } } } return result ; }
Merge the column span information and the optional columnClasses attribute .