writer.writeClassAttribute(Classes.create(tabGroup, "headerInner"));
int index = 0;
for (final UIComponent child : tabGroup.getChildren()) {
if (child instanceof UITab) {
final UITab tab = (UITab) child;
if (tab.isRendered()) {
final LabelWithAccessKey label = new LabelWithAccessKey(tab);
final boolean disabled = tab.isDisabled();
if (activeIndex == index) {
ComponentUtils.addCurrentMarkup(tab, Markup.SELECTED);
}
final FacesMessage.Severity maxSeverity
= ComponentUtils.getMaximumSeverityOfChildrenMessages(facesContext, tab);
if (maxSeverity != null) {
ComponentUtils.addCurrentMarkup(tab, ComponentUtils.markupOfSeverity(maxSeverity));
}
writer.startElement(HtmlElements.DIV, tab);
writer.writeClassAttribute(Classes.create(tab));
writer.writeAttribute(HtmlAttributes.TABGROUPINDEX, index);
final String title = HtmlRendererUtils.getTitleFromTipAndMessages(facesContext, tab);
if (title != null) {
writer.writeAttribute(HtmlAttributes.TITLE, title, true);
}
writer.startElement(HtmlElements.A, tab);
if (!disabled) {
writer.writeAttribute(HtmlAttributes.HREF, "#", false);
}
final String tabId = tab.getClientId(facesContext);
writer.writeIdAttribute(tabId);
if (label.getAccessKey() != null) {
writer.writeAttribute(HtmlAttributes.ACCESSKEY, Character.toString(label.getAccessKey()), false);
}
String image = tab.getImage();
if (image != null) {
if (ResourceManagerUtils.isAbsoluteResource(image)) {
// absolute Path to image : nothing to do
} else {
image = ResourceManagerUtils.getImageOrDisabledImageWithPath(facesContext, image, disabled);
}
writer.startElement(HtmlElements.IMG, null);
writer.writeAttribute(HtmlAttributes.SRC, image, true);
writer.writeClassAttribute(Classes.create(tab, (label.getText() != null? "image-right-margin" : "image")));
writer.endElement(HtmlElements.IMG);
}
if (label.getText() != null) {
HtmlRendererUtils.writeLabelWithAccessKey(writer, label);
} else if (image == null) {
writer.writeText(Integer.toString(index + 1));
}
writer.endElement(HtmlElements.A);
final UIPanel toolbar = (UIPanel) tab.getFacet(Facets.TOOL_BAR);
if (toolbar != null) {
renderTabToolbar(facesContext, writer, tab, toolbar);
}
if (label.getAccessKey() != null) {