Package org.primefaces.component.tabmenu

Examples of org.primefaces.component.tabmenu.TabMenu


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");
View Full Code Here


        writer.endElement("div");
    }
   
    @Override
    protected void encodeScript(FacesContext context, AbstractMenu abstractMenu) throws IOException {
        TabMenu menu = (TabMenu) abstractMenu;
    String clientId = menu.getClientId(context);
        WidgetBuilder wb = getWidgetBuilder(context);
        wb.init("TabMenu", menu.resolveWidgetVar(), clientId).attr("activeIndex", menu.getActiveIndex());
        wb.finish();
    }
View Full Code Here

TOP

Related Classes of org.primefaces.component.tabmenu.TabMenu

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.