public class TabMenuRenderer extends BaseMenuRenderer {
@Override
protected void encodeMarkup(FacesContext context, AbstractMenu component) throws IOException {
ResponseWriter writer = context.getResponseWriter();
TabMenu tabMenu = (TabMenu) component;
List<MenuElement> elements = tabMenu.getElements();
String style = tabMenu.getStyle();
String styleClass = tabMenu.getStyleClass();
styleClass = (styleClass == null) ? TabMenu.MOBILE_CONTAINER_CLASS : TabMenu.MOBILE_CONTAINER_CLASS + " " + styleClass;
writer.startElement("div", tabMenu);
writer.writeAttribute("id", tabMenu.getClientId(context), null);
writer.writeAttribute("class", styleClass, null);
writer.writeAttribute("role", "navigation", null);
if(style != null) {
writer.writeAttribute("style", style, null);
}
writer.startElement("ul", tabMenu);
if(tabMenu.getElementsCount() > 0) {
for(MenuElement element : elements) {
if(element.isRendered() && element instanceof MenuItem) {
writer.startElement("li", null);
encodeMenuItem(context, tabMenu, (MenuItem) element);
writer.endElement("li");