private static void encodeTabContentPanes ( final FacesContext context , final ResponseWriter writer , final TabView tabView , final int currentlyActiveIndex , final List < UIComponent > tabs ) throws IOException { writer . startElement ( "div" , tabView ) ; String classes = "tab-content" ; if ( tabView . getContentClass ( ) != null ) { classes += " " ; classes += tabView . getContentClass ( ) ; } writer . writeAttribute ( "class" , classes , "class" ) ; if ( tabView . getContentStyle ( ) != null ) { String inlineCSS = tabView . getContentStyle ( ) ; writer . writeAttribute ( "style" , inlineCSS , "style" ) ; } String role = "tablist" ; if ( tabView . getRole ( ) != null ) { role = tabView . getRole ( ) ; } writer . writeAttribute ( "role" , role , "role" ) ; if ( null != tabs ) { int numberOfTabsRendered = 0 ; for ( int index = 0 ; index < tabs . size ( ) ; index ++ ) { final Tab tab = ( Tab ) tabs . get ( index ) ; if ( tab . isRendered ( ) ) { final int currentIndex = numberOfTabsRendered ; Runnable r = new Runnable ( ) { int offset = 0 ; public void run ( ) { try { encodeTabPane ( context , writer , tab , ( currentIndex + offset == currentlyActiveIndex ) && ( ! tabView . isDisabled ( ) ) ) ; 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 . getValue ( ) == null ) { r . run ( ) ; numberOfTabsRendered ++ ; } else { numberOfTabsRendered += ( ( Tab ) tabs . get ( currentIndex ) ) . encodeTabs ( context , r ) ; } } } } writer . endElement ( "div" ) ; }
Generates the HTML of the tab panes .