writer.startElement(HtmlConstants.TR, null);
writer.writeAttribute(HtmlAttributes.VALIGN, "bottom", false);
writer.startElement(HtmlConstants.TD, null);
HtmlStyleMap headerStyle = (HtmlStyleMap) component.getAttributes().get(ATTR_STYLE_HEADER);
headerStyle.put("position", "relative");
headerStyle.put("width", headerStyle.getInt("width"));
int width = headerStyle.getInt("width");
writer.writeStyleAttribute(headerStyle);
writer.startElement(HtmlConstants.DIV, null);
writer.writeStyleAttribute(headerStyle);
writer.startElement(HtmlConstants.DIV, null);
HtmlStyleMap map = new HtmlStyleMap();
if (currentWidth > width) {
map.put("width", currentWidth);
map.put("left", width - toolbarWidth - currentWidth);
} else {
map.put("width", width - toolbarWidth);
}
map.put("overflow", "hidden");
map.put("position", "absolute");
writer.writeStyleAttribute(map);
writer.startElement(HtmlConstants.TABLE, component);
writer.writeAttribute(HtmlAttributes.BORDER, 0);
writer.writeAttribute(HtmlAttributes.CELLPADDING, 0);
writer.writeAttribute(HtmlAttributes.CELLSPACING, 0);
writer.writeAttribute(HtmlAttributes.SUMMARY, "", false);
headerStyle = (HtmlStyleMap) component.getAttributes().get(ATTR_STYLE_HEADER);
writer.writeStyleAttribute(headerStyle);
writer.startElement(HtmlConstants.COLGROUP, null);
for (Integer colWidth : tabList.getWidthList()) {
writer.startElement(HtmlConstants.COL, null);
writer.writeAttribute(HtmlAttributes.WIDTH, colWidth);
writer.endElement(HtmlConstants.COL);
}
writer.endElement(HtmlConstants.COLGROUP);
writer.startElement(HtmlConstants.TR, null);
writer.writeAttribute(HtmlAttributes.VALIGN, "bottom", false);
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);