private static void encodeTabs ( final FacesContext context , final ResponseWriter writer , final List < UIComponent > children , final int currentlyActiveIndex , final String hiddenInputFieldID , final boolean disabled ) throws IOException { if ( null != children ) { int tabIndex = 0 ; for ( int index = 0 ; index < children . size ( ) ; index ++ ) { // todo what's the meaning of those countless parameters? final int loopIndex = index ; final int currentIndex = tabIndex ; final Tab tab = ( Tab ) children . get ( loopIndex ) ; Runnable r = new Runnable ( ) { int offset = 0 ; public void run ( ) { try { encodeTab ( context , writer , tab , currentIndex + offset == currentlyActiveIndex , hiddenInputFieldID , currentIndex + offset , disabled ) ; offset ++ ; } catch ( IOException ex ) { // exotic case, suffice it to log it LOGGER . log ( Level . SEVERE , "An exception occurred while rendering a tab." , ex ) ; } } } ; if ( ( ( Tab ) children . get ( index ) ) . getValue ( ) == null ) { r . run ( ) ; tabIndex ++ ; } else { tabIndex += tab . encodeTabs ( context , r ) ; } } } }
Generates the HTML of the tabs .