Package org.primefaces.component.menu

Examples of org.primefaces.component.menu.Menu


  }
 
  protected void encodeMarkup(FacesContext facesContext, Panel panel) throws IOException{
    ResponseWriter writer = facesContext.getResponseWriter();
    String clientId = panel.getClientId(facesContext);
    Menu optionsMenu = panel.getOptionsMenu();
   
    writer.startElement("div", null);
    writer.writeAttribute("id", clientId, null);
   
    String styleClass = panel.getStyleClass() != null ? Panel.PANEL_CLASS + " " + panel.getStyleClass() : Panel.PANEL_CLASS;
    writer.writeAttribute("class", styleClass, "styleClass");
    if(panel.getStyle() != null)
      writer.writeAttribute("style", panel.getStyle(), "style");
   
    encodeHeader(facesContext, panel);
    encodeContent(facesContext, panel);
    encodeFooter(facesContext, panel);

    if(panel.isToggleable())
      encodeStateHolder(facesContext, panel, clientId + "_collapsed", String.valueOf(panel.isCollapsed()));
   
    if(panel.isClosable())
      encodeStateHolder(facesContext, panel, clientId + "_visible", String.valueOf(panel.isVisible()));
   
    if(optionsMenu != null) {
      optionsMenu.setPosition("dynamic");
      optionsMenu.setContext("'" + clientId + "_menu','tl','bl'");
     
      optionsMenu.encodeAll(facesContext);
    }
   
    writer.endElement("div");
  }
View Full Code Here


public class MenuRenderer extends BaseMenuRenderer {
   
    @Override
    protected void encodeMarkup(FacesContext context, AbstractMenu abstractMenu) throws IOException {
        ResponseWriter writer = context.getResponseWriter();
        Menu menu = (Menu) abstractMenu;
    String clientId = menu.getClientId(context);
        String style = menu.getStyle();
        String styleClass = menu.getStyleClass();
        styleClass = (styleClass == null) ? Menu.MOBILE_CONTAINER_CLASS: Menu.MOBILE_CONTAINER_CLASS + " " + styleClass;
       
        writer.startElement("ul", null);
        writer.writeAttribute("id", clientId, "id");
        writer.writeAttribute("class", styleClass, "styleClass");
        if (style != null) {
            writer.writeAttribute("style", style, "style");
        }
       
        renderDynamicPassThruAttributes(context, menu);

        if (menu.getElementsCount() > 0) {
            encodeElements(context, menu, menu.getElements());
        }
       
        writer.endElement("ul");
    }
View Full Code Here

            }
        }
    }

    protected void encodeScript(FacesContext context, AbstractMenu abstractMenu) throws IOException {
        Menu menu = (Menu) abstractMenu;
    String clientId = menu.getClientId(context);
       
        WidgetBuilder wb = getWidgetBuilder(context);
        wb.initWithDomReady("PlainMenu", menu.resolveWidgetVar(), clientId);
        wb.finish();
  }
View Full Code Here

    protected void encodeMarkup(FacesContext context, Panel panel) throws IOException {
        ResponseWriter writer = context.getResponseWriter();
        String clientId = panel.getClientId(context);
        String widgetVar = panel.resolveWidgetVar();
        Menu optionsMenu = panel.getOptionsMenu();
        boolean collapsed = panel.isCollapsed();
        boolean visible = panel.isVisible();
       
        writer.startElement("div", null);
        writer.writeAttribute("id", clientId, null);
        String styleClass = panel.getStyleClass() == null ? Panel.PANEL_CLASS : Panel.PANEL_CLASS + " " + panel.getStyleClass();
       
        if(collapsed) {
            styleClass += " ui-hidden-container";
           
            if(panel.getToggleOrientation().equals("horizontal")) {
                styleClass += " ui-panel-collapsed-h";
            }
        }
       
        if(!visible) {
            styleClass += " ui-helper-hidden";
        }
           
        writer.writeAttribute("class", styleClass, "styleClass");
       
        if(panel.getStyle() != null) {
            writer.writeAttribute("style", panel.getStyle(), "style");
        }
       
        writer.writeAttribute(HTML.WIDGET_VAR, widgetVar, null);
       
        renderDynamicPassThruAttributes(context, panel);

        encodeHeader(context, panel);
        encodeContent(context, panel);
        encodeFooter(context, panel);

        if(panel.isToggleable()) {
            encodeStateHolder(context, panel, clientId + "_collapsed", String.valueOf(collapsed));
        }

        if(panel.isClosable()) {
            encodeStateHolder(context, panel, clientId + "_visible", String.valueOf(visible));
        }

        if (optionsMenu != null) {
            optionsMenu.setOverlay(true);
            optionsMenu.setTrigger("@(" + ComponentUtils.escapeJQueryId(clientId) + "_menu)");
            optionsMenu.setMy("left top");
            optionsMenu.setAt("left bottom");

            optionsMenu.encodeAll(context);
        }

        writer.endElement("div");
    }
View Full Code Here

    }

    protected void encodeMarkup(FacesContext context, Panel panel) throws IOException {
        ResponseWriter writer = context.getResponseWriter();
        String clientId = panel.getClientId(context);
        Menu optionsMenu = panel.getOptionsMenu();

        writer.startElement("div", null);
        writer.writeAttribute("id", clientId, null);
        String styleClass = panel.getStyleClass() != null ? Panel.PANEL_CLASS + " " + panel.getStyleClass() : Panel.PANEL_CLASS;
        writer.writeAttribute("class", styleClass, "styleClass");
        if(panel.getStyle() != null) {
            writer.writeAttribute("style", panel.getStyle(), "style");
        }

        encodeHeader(context, panel);
        encodeContent(context, panel);
        encodeFooter(context, panel);

        if(panel.isToggleable()) {
            encodeStateHolder(context, panel, clientId + "_collapsed", String.valueOf(panel.isCollapsed()));
        }

        if(panel.isClosable()) {
            encodeStateHolder(context, panel, clientId + "_visible", String.valueOf(panel.isVisible()));
        }

        if (optionsMenu != null) {
            optionsMenu.setPosition("dynamic");
            optionsMenu.setTrigger(clientId + "_menu");
            optionsMenu.setMy("left top");
            optionsMenu.setAt("left bottom");

            optionsMenu.encodeAll(context);
        }

        writer.endElement("div");
    }
View Full Code Here

  }
 
  protected void encodeMarkup(FacesContext facesContext, Panel panel) throws IOException{
    ResponseWriter writer = facesContext.getResponseWriter();
    String clientId = panel.getClientId(facesContext);
    Menu optionsMenu = panel.getOptionsMenu();
   
    writer.startElement("div", null);
    writer.writeAttribute("id", clientId, null);
   
    String styleClass = panel.getStyleClass() != null ? Panel.PANEL_CLASS + " " + panel.getStyleClass() : Panel.PANEL_CLASS;
    writer.writeAttribute("class", styleClass, "styleClass");
   
    if(panel.getStyle() != null) {
      writer.writeAttribute("style", panel.getStyle(), "style");
    }
   
    encodeHeader(facesContext, panel);
    encodeContent(facesContext, panel);
    encodeFooter(facesContext, panel);
    encodePanelControls(facesContext, panel);

    if(panel.isToggleable())
      encodeStateHolder(facesContext, panel, clientId + "_collapsed", String.valueOf(panel.isCollapsed()));
   
    if(panel.isClosable())
      encodeStateHolder(facesContext, panel, clientId + "_visible", String.valueOf(panel.isVisible()));
   
    if(optionsMenu != null) {
      optionsMenu.setPosition("dynamic");
      optionsMenu.setContext("'" + clientId + "_menu','tl','bl'");
     
      optionsMenu.encodeAll(facesContext);
    }
   
    writer.endElement("div");
  }
View Full Code Here

TOP

Related Classes of org.primefaces.component.menu.Menu

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.