Package org.primefaces.component.submenu

Examples of org.primefaces.component.submenu.Submenu


            model.addMenuItem(item);
        }

        //Applications
        if (returnRole("11")) {
            Submenu appMenu = new Submenu();
            appMenu.setLabel("Applications");
            appMenu.setIcon("ui-icon-note");

            item = new MenuItem();
            item.setValue("Start New Application");
            item.setUrl(this.getURL("applicationCreate"));
            appMenu.getChildren().add(item);

            model.addSubmenu(appMenu);
        }
        //Authorization

        if (returnRole("12")) {                //AUTHORIZER
            Submenu authMenu = new Submenu();
            authMenu.setLabel("Authorizations");
            authMenu.setIcon("ui-icon-circle-check");

            item = new MenuItem();
            item.setValue("Manage Authorizations");
            item.setUrl(this.getURL("authorizerHome"));
            authMenu.getChildren().add(item);
            model.addSubmenu(authMenu);
        }

        if (returnRole("22")) {
            Submenu superMenu = new Submenu();
            superMenu.setLabel("Actions");
            superMenu.setIcon("ui-icon-wrench");

            item = new MenuItem();
            item.setValue("Create Admin");
            item.setUrl(this.getURL("createAdmin"));
            superMenu.getChildren().add(item);
            model.addSubmenu(superMenu);

            item = new MenuItem();
            item.setValue("Edit Admin");
            item.setUrl(this.getURL("editAdminSelect"));
            superMenu.getChildren().add(item);
            model.addSubmenu(superMenu);

            item = new MenuItem();
            item.setValue("Create Role");
            item.setUrl(this.getURL("createRole"));
            superMenu.getChildren().add(item);
            model.addSubmenu(superMenu);

            item = new MenuItem();
            item.setValue("Deactivate Account");
            item.setUrl(this.getURL("deactivateAccount"));
            superMenu.getChildren().add(item);
            model.addSubmenu(superMenu);

            item = new MenuItem();
            item.setValue("Department Handler");
            item.setUrl(this.getURL("departmentHandler"));
            superMenu.getChildren().add(item);
            model.addSubmenu(superMenu);
        }

    }
View Full Code Here


            model.addMenuItem(item);
        }

        //Applications
        if (returnRole("11")) {
            Submenu appMenu = new Submenu();
            appMenu.setLabel("Applications");
            appMenu.setIcon("ui-icon-note");

            item = new MenuItem();
            item.setValue("Start New Application");
            item.setUrl(this.getURL("applicationCreate"));
            appMenu.getChildren().add(item);

            model.addSubmenu(appMenu);
        }
        //Authorization

        if (returnRole("12")) {                //AUTHORIZER
            Submenu authMenu = new Submenu();
            authMenu.setLabel("Authorizations");
            authMenu.setIcon("ui-icon-circle-check");

            item = new MenuItem();
            item.setValue("Manage Authorizations");
            item.setUrl(this.getURL("authorizerHome"));
            authMenu.getChildren().add(item);
            model.addSubmenu(authMenu);
        }

        if (returnRole("22")) {
            Submenu superMenu = new Submenu();
            superMenu.setLabel("Actions");
            superMenu.setIcon("ui-icon-wrench");

            item = new MenuItem();
            item.setValue("Create Admin");
            item.setUrl(this.getURL("createAdmin"));
            superMenu.getChildren().add(item);
            model.addSubmenu(superMenu);

            item = new MenuItem();
            item.setValue("Edit Admin");
            item.setUrl(this.getURL("editAdminSelect"));
            superMenu.getChildren().add(item);
            model.addSubmenu(superMenu);

            item = new MenuItem();
            item.setValue("Create Role");
            item.setUrl(this.getURL("createRole"));
            superMenu.getChildren().add(item);
            model.addSubmenu(superMenu);

            item = new MenuItem();
            item.setValue("Deactivate Account");
            item.setUrl(this.getURL("deactivateAccount"));
            superMenu.getChildren().add(item);
            model.addSubmenu(superMenu);
           
            item = new MenuItem();
            item.setValue("Reactivate Account");
            item.setUrl(this.getURL("reactivateAccount"));
            superMenu.getChildren().add(item);
            model.addSubmenu(superMenu);

            item = new MenuItem();
            item.setValue("Department Handler");
            item.setUrl(this.getURL("departmentHandler"));
            superMenu.getChildren().add(item);
            model.addSubmenu(superMenu);
        }

    }
View Full Code Here

   
    writer.startElement("ul", null);
    writer.writeAttribute("class", "ui-state-default", null);
   
    for(UIComponent child : menubar.getChildren()) {
      Submenu submenu = (Submenu) child;
     
      if(submenu.isRendered()) {
        writer.startElement("li", null);
        writer.writeAttribute("class", "ui-menubar-item" , null);
       
        encodeSubmenu(facesContext, submenu);
       
View Full Code Here

       
        if(child instanceof MenuItem) {
          MenuItem menuItem = (MenuItem) child;
          encodeMenuItem(facesContext, menuItem, "ui-menu-item-label ui-corner-all");
        } else if(child instanceof Submenu) {
          Submenu childSubmenu = (Submenu) child;
          encodeSubmenu(facesContext, childSubmenu);
        }
       
        writer.endElement("li");
      }
View Full Code Here

  protected void encodeRegularMenu(FacesContext facesContext, Menu menu) throws IOException{
    ResponseWriter writer = facesContext.getResponseWriter();
   
    for(UIComponent child : menu.getChildren()) {
      Submenu submenu = (Submenu) child;
     
      if(submenu.isRendered()) {
       
        //Submenu label
        if(submenu.getLabel() != null) {
          writer.startElement("div", null);
          String defaultLabelClass = "ui-submenu-label ui-widget-header ui-corner-all";
          String styleClass = submenu.getLabelStyleClass() == null ? defaultLabelClass : defaultLabelClass + " " + submenu.getLabelStyleClass();
          writer.writeAttribute("class", styleClass, null);
           
          if(submenu.getLabelStyle() != null)
            writer.writeAttribute("style", submenu.getLabelStyle(), null);
     
          writer.write(submenu.getLabel());
           
          writer.endElement("div");
        }
         
        //Submenu content
View Full Code Here

        model.addMenuItem(item);

       
        //Submenu 
        Submenu submenu = new Submenu();
        submenu.setLabel("Applications");
        submenu.setIcon("ui-icon-note");

        item = new MenuItem();
        item.setValue("Start New Application");
        item.setUrl("#");
        submenu.getChildren().add(item);

        item = new MenuItem();
        item.setValue("Manage Applications");
        item.setUrl("#");
        submenu.getChildren().add(item);

        model.addSubmenu(submenu);
    }
View Full Code Here

            model.addMenuItem(item);
        }

        //Applications
        if (returnRole("11")) {
            Submenu appMenu = new Submenu();
            appMenu.setLabel("Applications");
            appMenu.setIcon("ui-icon-note");

            item = new MenuItem();
            item.setValue("Start New Application");
            item.setUrl(this.getURL("applicationCreate"));
            appMenu.getChildren().add(item);

            model.addSubmenu(appMenu);
        }
        //Authorization

        if (returnRole("12")) {                //AUTHORIZER
            Submenu authMenu = new Submenu();
            authMenu.setLabel("Authorizations");
            authMenu.setIcon("ui-icon-circle-check");

            item = new MenuItem();
            item.setValue("Manage Authorizations");
            item.setUrl(this.getURL("authorizerHome"));
            authMenu.getChildren().add(item);
            model.addSubmenu(authMenu);


        }

        if (returnRole("22")) {
            Submenu superMenu = new Submenu();
            superMenu.setLabel("Actions");
            superMenu.setIcon("ui-icon-wrench");

            item = new MenuItem();
            item.setValue("Create Admin");
            item.setUrl(this.getURL("createAdmin"));
            superMenu.getChildren().add(item);
            model.addSubmenu(superMenu);

            item = new MenuItem();
            item.setValue("Edit Admin");
            item.setUrl(this.getURL("editAdminSelect"));
            superMenu.getChildren().add(item);
            model.addSubmenu(superMenu);

            item = new MenuItem();
            item.setValue("Deactivate Account");
            item.setUrl(this.getURL("deactivateAccount"));
            superMenu.getChildren().add(item);
            model.addSubmenu(superMenu);

            item = new MenuItem();
            item.setValue("Reactivate Account");
            item.setUrl(this.getURL("reactivateAccount"));
            superMenu.getChildren().add(item);
            model.addSubmenu(superMenu);

            item = new MenuItem();
            item.setValue("Department Handler");
            item.setUrl(this.getURL("departmentHandler"));
            superMenu.getChildren().add(item);
            model.addSubmenu(superMenu);
        }

        if (!returnRole("11")) {
            //Go on leave
View Full Code Here

            model.addMenuItem(item);
        }

        //Applications
        if (returnRole("11")) {
            Submenu appMenu = new Submenu();
            appMenu.setLabel("Applications");
            appMenu.setIcon("ui-icon-note");

            item = new MenuItem();
            item.setValue("Start New Application");
            item.setUrl(this.getURL("applicationCreate"));
            appMenu.getChildren().add(item);

            model.addSubmenu(appMenu);
        }
        //Authorization

        if (returnRole("12")) {                //AUTHORIZER
            Submenu authMenu = new Submenu();
            authMenu.setLabel("Authorizations");
            authMenu.setIcon("ui-icon-circle-check");

            item = new MenuItem();
            item.setValue("Manage Authorizations");
            item.setUrl(this.getURL("authorizerHome"));
            authMenu.getChildren().add(item);
            model.addSubmenu(authMenu);
        }

        if (returnRole("22")) {
            Submenu superMenu = new Submenu();
            superMenu.setLabel("Actions");
            superMenu.setIcon("ui-icon-wrench");

            item = new MenuItem();
            item.setValue("Create Admin");
            item.setUrl(this.getURL("createAdmin"));
            superMenu.getChildren().add(item);
            model.addSubmenu(superMenu);

            item = new MenuItem();
            item.setValue("Edit Admin");
            item.setUrl(this.getURL("editAdminSelect"));
            superMenu.getChildren().add(item);
            model.addSubmenu(superMenu);

            item = new MenuItem();
            item.setValue("Create Role");
            item.setUrl(this.getURL("createRole"));
            superMenu.getChildren().add(item);
            model.addSubmenu(superMenu);

            item = new MenuItem();
            item.setValue("Deactivate Account");
            item.setUrl(this.getURL("deactivateAccount"));
            superMenu.getChildren().add(item);
            model.addSubmenu(superMenu);

            item = new MenuItem();
            item.setValue("Department Handler");
            item.setUrl(this.getURL("departmentHandler"));
            superMenu.getChildren().add(item);
            model.addSubmenu(superMenu);
        }

    }
View Full Code Here

        /*
         * For now we default to just one course at a time, since we have not
         * implemented support for multiple courses as of yet.
         */
        Submenu defaultCourse = new Submenu();
        defaultCourse.setLabel("Objekt Orienterad Programmering IT");

        /*
         * add each assignment associated with this course
         */
        ExpressionFactory expressionFactory =
                FacesContext.getCurrentInstance()
                .getApplication()
                .getExpressionFactory();

        for (Assignment assignment : assignmentManager.getAll()) {

            String assignmentTitle = assignment.getTitle();
            MenuItem menuItem = new MenuItem();
            menuItem.setValue(assignmentTitle);

            MethodExpression expression = expressionFactory.createMethodExpression(
                    FacesContext.getCurrentInstance().getELContext(), "#{gradingBean.selectLab('"+ assignmentTitle + "')}", String.class, new Class[]{String.class});

            menuItem.setActionExpression(expression);
            defaultCourse.getChildren().add(menuItem);
        }
        courseView.addSubmenu(defaultCourse);

        FireLogger.logInfo("Constructed courseMenu");
    }
View Full Code Here

   
    writer.startElement("ul", null);
    writer.writeAttribute("class", "first-of-type", null);
   
    for (int i=0; i < submenus.size(); i++) {
      Submenu submenu = (Submenu) submenus.get(i);
     
      encodeTieredSubmenu(facesContext, submenu);
    }
   
    writer.endElement("ul");
View Full Code Here

TOP

Related Classes of org.primefaces.component.submenu.Submenu

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.