Package org.primefaces.model.menu

Examples of org.primefaces.model.menu.MenuItem


       
            for(int i = 0; i < elementCount; i++) {
                MenuElement element = menuElements.get(i);

                if(element.isRendered() && element instanceof MenuItem) {
                    MenuItem item = (MenuItem) element;

                    //dont render chevron before home icon
                    if(i != 0) {
                        writer.startElement("li", null);
                        writer.writeAttribute("class", BreadCrumb.CHEVRON_CLASS, null);
                        writer.endElement("li");
                    }

                    writer.startElement("li", null);
                    writer.writeAttribute("role", "menuitem", null);

                    if(item.isDisabled())
                        encodeDisabledMenuItem(context, item);
                    else
                        encodeMenuItem(context, menu, item);

                    writer.endElement("li");               
View Full Code Here


            writer.writeAttribute("class", PanelMenu.LIST_CLASS, null);

            for(MenuElement element : elements) {
                if(element.isRendered()) {
                    if(element instanceof MenuItem) {
                        MenuItem menuItem = (MenuItem) element;
                        String containerStyle = menuItem.getContainerStyle();
                        String containerStyleClass = menuItem.getContainerStyleClass();
                        containerStyleClass = (containerStyleClass == null) ? Menu.MENUITEM_CLASS: Menu.MENUITEM_CLASS + " " + containerStyleClass;
                       
                        writer.startElement("li", null);
                        writer.writeAttribute("class", containerStyleClass, null);
                        writer.writeAttribute("role", "menuitem", null);
View Full Code Here

        String clientId = menu.getClientId(context);
        Map<String,String> params = context.getExternalContext().getRequestParameterMap();
       
        if(params.containsKey(clientId)) {
            String menuid = params.get(clientId + "_menuid");
            MenuItem menuitem = findMenuitem(menu.getElements(), menuid);
            MenuActionEvent event = new MenuActionEvent(menu, menuitem);

            if(menuitem.isImmediate())
                event.setPhaseId(PhaseId.APPLY_REQUEST_VALUES);
            else
                event.setPhaseId(PhaseId.INVOKE_APPLICATION);
           
            menu.queueEvent(event);
View Full Code Here

        ResponseWriter writer = context.getResponseWriter();
       
        for(MenuElement element : elements) {
            if(element.isRendered()) {
                if(element instanceof MenuItem) {
                    MenuItem menuItem = (MenuItem) element;
                    String containerStyle = menuItem.getContainerStyle();
                    String containerStyleClass = menuItem.getContainerStyleClass();
                    containerStyleClass = (containerStyleClass == null) ? Menu.MENUITEM_CLASS: Menu.MENUITEM_CLASS + " " + containerStyleClass;
                   
                    writer.startElement("li", null);
                    writer.writeAttribute("class", containerStyleClass, null);
                    writer.writeAttribute("role", "menuitem", null);
View Full Code Here

    ResponseWriter writer = context.getResponseWriter();
       
        for(MenuElement element : elements) {
            if(element.isRendered()) {
                if(element instanceof MenuItem) {
                    MenuItem menuItem = (MenuItem) element;
                    String containerStyle = menuItem.getContainerStyle();
                    String containerStyleClass = menuItem.getContainerStyleClass();
                    containerStyleClass = (containerStyleClass == null) ? Menu.MENUITEM_CLASS: Menu.MENUITEM_CLASS + " " + containerStyleClass;
                           
                    writer.startElement("li", null);
                    writer.writeAttribute("class", containerStyleClass, null);
                    writer.writeAttribute("role", "menuitem", null);
View Full Code Here

    public void broadcast(FacesEvent event) throws AbortProcessingException {
        if(event instanceof MenuActionEvent) {
            FacesContext facesContext = getFacesContext();
            ELContext eLContext = facesContext.getELContext();
            MenuActionEvent menuActionEvent = (MenuActionEvent) event;
            MenuItem menuItem = menuActionEvent.getMenuItem();
            String command = menuItem.getCommand();
           
            if(command != null) {
                String actionExpressionString = menuItem.getCommand();
                MethodExpression noArgExpr = facesContext.getApplication().getExpressionFactory().
                                createMethodExpression(eLContext,actionExpressionString,
                                                            String.class, new Class[0]);
                Object outcome = null;
View Full Code Here

            writer.startElement("ul", null);
            writer.writeAttribute("id", clientId + "_stack", "id");
   
            for(MenuElement element : elements) {
                if(element.isRendered() && element instanceof MenuItem) {
                    MenuItem menuItem = (MenuItem) element;
                    String containerStyle = menuItem.getContainerStyle();
                    String containerStyleClass = menuItem.getContainerStyleClass();
                    writer.startElement("li", null);
                    if(containerStyle != null) writer.writeAttribute("style", containerStyle, null);
                    if(containerStyleClass != null) writer.writeAttribute("class", containerStyleClass, null);
                   
View Full Code Here

            writer.writeAttribute("class", PanelMenu.LIST_CLASS, null);

            for(MenuElement element : elements) {
                if(element.isRendered()) {
                    if(element instanceof MenuItem) {
                        MenuItem menuItem = (MenuItem) element;
                        String containerStyle = menuItem.getContainerStyle();
                        String containerStyleClass = menuItem.getContainerStyleClass();
                        containerStyleClass = (containerStyleClass == null) ? Menu.MENUITEM_CLASS: Menu.MENUITEM_CLASS + " " + containerStyleClass;
                       
                        writer.startElement("li", null);
                        writer.writeAttribute("class", containerStyleClass, null);
                        writer.writeAttribute("role", "menuitem", null);
View Full Code Here

    ResponseWriter writer = context.getResponseWriter();
       
        for(MenuElement element : elements) {
            if(element.isRendered()) {
                if(element instanceof MenuItem) {
                    MenuItem menuItem = (MenuItem) element;
                    String containerStyle = menuItem.getContainerStyle();
                    String containerStyleClass = menuItem.getContainerStyleClass();
                    containerStyleClass = (containerStyleClass == null) ? Menu.MENUITEM_CLASS: Menu.MENUITEM_CLASS + " " + containerStyleClass;
                           
                    writer.startElement("li", null);
                    writer.writeAttribute("class", containerStyleClass, null);
                    writer.writeAttribute("role", "menuitem", null);
View Full Code Here

        String clientId = menu.getClientId(context);
        Map<String,String> params = context.getExternalContext().getRequestParameterMap();
       
        if(params.containsKey(clientId)) {
            String menuid = params.get(clientId + "_menuid");
            MenuItem menuitem = findMenuitem(menu.getElements(), menuid);
            MenuActionEvent event = new MenuActionEvent(menu, menuitem);

            if(menuitem.isImmediate())
                event.setPhaseId(PhaseId.APPLY_REQUEST_VALUES);
            else
                event.setPhaseId(PhaseId.INVOKE_APPLICATION);
           
            menu.queueEvent(event);
View Full Code Here

TOP

Related Classes of org.primefaces.model.menu.MenuItem

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.