UIToolBar toolBar = null;
if (toolbarWidth > 0) {
toolBar = createToolBar(facesContext, component, virtualTab, switchType, tabList, clientId);
}
UITab activeTab = null;
int index = 0;
for (UIComponent child : (List<UIComponent>) component.getChildren()) {
if (child instanceof UITab) {
UITab tab = (UITab) child;
if (tab.isRendered()) {
String onclick;
if (TobagoConfig.getInstance(facesContext).isAjaxEnabled()
&& SWITCH_TYPE_RELOAD_TAB.equals(switchType)) {
onclick = null;
} else {
onclick = "tobago_switchTab('"+ switchType + "','" + clientId + "'," + index + ','
+ component.getChildCount() + ')';
}
LabelWithAccessKey label = new LabelWithAccessKey(tab);
StyleClasses outerClass = new StyleClasses();
StyleClasses innerClass = new StyleClasses();
if (virtualTab == index) {
outerClass.addClass("tab", "selected-outer");
innerClass.addClass("tab", "selected-inner");
activeTab = (UITab) tab;
} else {
outerClass.addClass("tab", "unselected-outer");
innerClass.addClass("tab", "unselected-inner");
}
outerClass.addMarkupClass(tab, "tab", "outer");
innerClass.addMarkupClass(tab, "tab", "outer");
writer.startElement(HtmlConstants.TD, tab);
map = new HtmlStyleMap();
map.put("width", tabList.getWidthList().get(index));
writer.writeStyleAttribute(map);
writer.writeIdAttribute(tab.getClientId(facesContext));
HtmlRendererUtil.renderTip(tab, writer);
writer.startElement(HtmlConstants.DIV, null);
writer.writeStyleAttribute(map);
writer.startElement(HtmlConstants.DIV, null);
writer.writeClassAttribute(outerClass);
//writer.writeStyleAttribute(map);
writer.startElement(HtmlConstants.DIV, null);
//writer.writeStyleAttribute(map);
writer.writeClassAttribute(innerClass);
writer.startElement(HtmlConstants.SPAN, null);
String tabId = clientId + "__" + virtualTab + "__" + index;
writer.writeIdAttribute(tabId);
if (tab.isDisabled()) {
writer.writeClassAttribute("tobago-tab-disabled");
} else {
writer.writeClassAttribute("tobago-tab-link");
if (onclick != null) {
writer.writeAttribute(HtmlAttributes.ONCLICK, onclick, true);