Package org.richfaces.component

Examples of org.richfaces.component.UIPanelMenuGroup


        buffer.append(","+'"'+PANEL_MENU_SPACER_ICON+'"').append(","+'"'+PANEL_MENU_SPACER_ICON+'"'+" ");
      }
      buffer.append(",\"\" ");
     
    } else if(component instanceof UIPanelMenuGroup){
      UIPanelMenuGroup group = (UIPanelMenuGroup)component;

      String defaultIconNodeClosed = isTopLevel ? (group.isDisabled() ? panelMenu.getIconTopDisableGroup() : panelMenu.getIconCollapsedTopGroup()) : (group.isDisabled() ? panelMenu.getIconDisabledGroup() : panelMenu.getIconCollapsedGroup());
     
      if(isTopLevel){
        if(group.isDisabled()){
          defaultIconNodeClosed = panelMenu.getIconTopDisableGroup();
          if(defaultIconNodeClosed == null || defaultIconNodeClosed.equals("")){
            defaultIconNodeClosed = panelMenu.getIconDisabledGroup();
          }
        } else {
          defaultIconNodeClosed = panelMenu.getIconCollapsedTopGroup();
          if(defaultIconNodeClosed == null || defaultIconNodeClosed.equals("")){
            defaultIconNodeClosed = panelMenu.getIconCollapsedGroup();
          }
        }
      } else {
        if(group.isDisabled()){
          defaultIconNodeClosed = panelMenu.getIconDisabledGroup();
        } else {
          defaultIconNodeClosed = panelMenu.getIconCollapsedGroup();
        }
      }
      if(defaultIconNodeClosed == null || defaultIconNodeClosed.equals("")){
        defaultIconNodeClosed = DEFAULT_ICON;
      }
      String defaultIconNodeOpened = isTopLevel ? panelMenu.getIconExpandedTopGroup() : panelMenu.getIconExpandedGroup();
     
      if(isTopLevel){
        defaultIconNodeOpened = panelMenu.getIconExpandedTopGroup();
        if(defaultIconNodeOpened == null || defaultIconNodeOpened.equals("")){
          defaultIconNodeOpened = panelMenu.getIconExpandedGroup();
        }
      } else {
        defaultIconNodeOpened = panelMenu.getIconExpandedGroup();
      }
      if(defaultIconNodeOpened == null || defaultIconNodeOpened.equals("")){
        defaultIconNodeOpened = DEFAULT_ICON;
      }
      String defaultIconNodeClosedSrc  = getIconByType(defaultIconNodeClosed, isTopLevel,context, component);
      String defaultIconNodeOpenedSrc  = getIconByType(defaultIconNodeOpened, isTopLevel,context, component);

      String iconExpanded = "";
      String iconCollapsed = "";
      String iconExpandedSource = "";
      String iconCollapsedSource = "";

      iconExpanded = group.isDisabled() ? group.getIconDisabled() : group.getIconExpanded();
      iconCollapsed = group.isDisabled() ? group.getIconDisabled() : group.getIconCollapsed();
      iconExpandedSource = getIconByType(iconExpanded,isTopLevel,context,component);
      iconCollapsedSource = getIconByType(iconCollapsed,isTopLevel,context,component);
     
      if(iconExpanded != null && !iconExpanded.equals("")){
        buffer.append(","+'"'+ iconExpandedSource + '"');
View Full Code Here


      UIPanelMenu panelMenu = (UIPanelMenu)component;
      if(panelMenu.getChildCount() > 0){
        for (Iterator<UIComponent> it = component.getChildren().iterator(); it.hasNext();) {
          UIComponent child = it.next();
          if(child instanceof UIPanelMenuGroup) {
            UIPanelMenuGroup group = (UIPanelMenuGroup)child;
   
            if(panelMenu.isExpandSingle()) { 
              if(!(Boolean)panelMenu.getAttributes().get("firstExpandedEncoded")) {
                if(group.isExpanded()) {
                  panelMenu.getAttributes().put("firstExpandedEncoded", true);
                }
              }else {
                group.setExpanded(false);
                if((Boolean)group.getValue()){
                  group.setValue(null);
                }
              }
            }           
          }
          renderChild(facesContext, child);
View Full Code Here

  }
 
  protected void doDecode(FacesContext context, UIComponent component) {
    String clientId = component.getClientId(context);
    Map<String, String> requestMap = context.getExternalContext().getRequestParameterMap();
    UIPanelMenuGroup group = ((UIPanelMenuGroup)component);
   
    if(requestMap.containsKey("panelMenuState"+clientId)){
      Object property = requestMap.get("panelMenuState"+clientId);
      if (property.equals("opened")) {
        group.setSubmittedValue("true");
      } else if (property.equals("closed")) {
        group.setSubmittedValue("false");
      }
     
    }
    if(isSubmitted(context, component)){
            new ActionEvent(component).queue();
View Full Code Here

    UIPanelMenu panelMenu = findMenu(component);
    if(panelMenu == null){
      return;
    }
    UIPanelMenuGroup panelMenuGroup = (UIPanelMenuGroup)component;
    boolean isTopLevel = isTopLevel(panelMenuGroup);

    boolean isOpened = isOpened(context,component);

   
    String defaultIconNodeClosed = null;
   
    if(isTopLevel){
      if(panelMenuGroup.isDisabled()){
        defaultIconNodeClosed = panelMenu.getIconTopDisableGroup();
        if(defaultIconNodeClosed == null || defaultIconNodeClosed.equals("")){
          defaultIconNodeClosed = panelMenu.getIconDisabledGroup();
        }
      } else {
        defaultIconNodeClosed = panelMenu.getIconCollapsedTopGroup();
        if(defaultIconNodeClosed == null || defaultIconNodeClosed.equals("")){
          defaultIconNodeClosed = panelMenu.getIconCollapsedGroup();
        }
      }
    } else {
      if(panelMenuGroup.isDisabled()){
        defaultIconNodeClosed = panelMenu.getIconDisabledGroup();
      } else {
        defaultIconNodeClosed = panelMenu.getIconCollapsedGroup();
      }
    }
    if(defaultIconNodeClosed == null || defaultIconNodeClosed.equals("")){
      defaultIconNodeClosed = DEFAULT_ICON;
    }
    String defaultIconNodeOpened = null;
   
    if(isTopLevel){
      defaultIconNodeOpened = panelMenu.getIconExpandedTopGroup();
      if(defaultIconNodeOpened == null || defaultIconNodeOpened.equals("")){
        defaultIconNodeOpened = panelMenu.getIconExpandedGroup();
      }
    } else {
      defaultIconNodeOpened = panelMenu.getIconExpandedGroup();
    }
    if(defaultIconNodeOpened == null || defaultIconNodeOpened.equals("")){
      defaultIconNodeOpened = DEFAULT_ICON;
    }
    String iconExpanded = "";
    String iconCollapsed = "";

    iconExpanded = panelMenuGroup.isDisabled() ? panelMenuGroup.getIconDisabled() : panelMenuGroup.getIconExpanded();
    iconCollapsed = panelMenuGroup.isDisabled() ? panelMenuGroup.getIconDisabled(): panelMenuGroup.getIconCollapsed();
   
    String icon = null;
    if(isOpened){
      if(iconExpanded != null && !iconExpanded.equals("")){
        if(iconExpanded.equals("none")){
View Full Code Here

    drawIcon(writer, icon, source, component, id, drawHidden);
  }

  public String getFullStyleClass(FacesContext context, UIComponent component) {
    StringBuffer classBuffer = new StringBuffer("");
    UIPanelMenuGroup group = (UIPanelMenuGroup)component;
    UIPanelMenu parentMenu = findMenu(group);
    if (!parentMenu.isDisabled() && !group.isDisabled()) {
      if (calculateLevel(group) == 0)
        classBuffer.append(parentMenu.getTopGroupClass() + " ");
      else
        classBuffer.append(parentMenu.getGroupClass() + " ");
      classBuffer.append(group.getStyleClass());
    } else
      classBuffer.append(parentMenu.getDisabledGroupClass() + " ")
        .append(group.getDisabledClass());
    return classBuffer.toString();
  }
View Full Code Here

    return classBuffer.toString();
  }
 
  public String getFullStyle(FacesContext context, UIComponent component) {
    StringBuffer styleBuffer = new StringBuffer("");
    UIPanelMenuGroup group = (UIPanelMenuGroup)component;
    UIPanelMenu parentMenu = findMenu(group);
    if (!group.isDisabled()) {
      if (calculateLevel(group) == 0)
        styleBuffer.append(parentMenu.getTopGroupStyle() + "; ");
      else
        styleBuffer.append(parentMenu.getGroupStyle() + "; ");
      styleBuffer.append(group.getStyle());
    } else
      styleBuffer.append(parentMenu.getDisabledGroupStyle() + "; ")
        .append(group.getDisabledStyle());
    return styleBuffer.toString();
  }
View Full Code Here

  public Object getConvertedValue(FacesContext context,
      UIComponent component, Object submittedValue)
      throws ConverterException {
   
    UIPanelMenuGroup group = (UIPanelMenuGroup)component;
    if(group.getConverter() != null){
      return group.getConverter().getAsObject(context, component, (String)submittedValue);
    } else {
      return submittedValue;
    }
   
  }
View Full Code Here

 
  public boolean isOpened(FacesContext context, UIComponent component)throws IOException {
   
    boolean value = false;
    if(component instanceof UIPanelMenuGroup){
      UIPanelMenuGroup group = (UIPanelMenuGroup)component;
      value = group.isExpanded();
     
      boolean isParentDisabled = isParentDisabled(component);
      boolean disabled = !group.isDisabled() && !isParentDisabled ;
     
      if( value && disabled){
        value = true;
      } else {
        //check expanded attributes in children groups, if exists
View Full Code Here

   
    return value;
  }
 
  public String getLabelClass(FacesContext context, UIComponent component) {
    UIPanelMenuGroup group = (UIPanelMenuGroup)component;
    UIPanelMenu parentMenu = findMenu(group);
    StringBuffer resClass = new StringBuffer();
    if(!group.isDisabled() && !parentMenu.isDisabled()){
      if(isTopLevel(component)){
        resClass.append("rich-pmenu-group-self-label rich-pmenu-top-group-self-label");
      } else resClass.append("rich-pmenu-group-self-label");
    }
   
View Full Code Here

   
    return resClass.toString();
  }
 
  public String getIconClass(FacesContext context, UIComponent component, String align) {
    UIPanelMenuGroup group = (UIPanelMenuGroup)component;
    UIPanelMenu parentMenu = findMenu(group);
    String iconClass = "";
   
    if(!group.isDisabled() && !parentMenu.isDisabled()){
      String iconClassAttr = ((UIPanelMenuGroup)component).getIconClass();
      if(isTopLevel(component)){
        if(align.equals(parentMenu.getIconGroupTopPosition())){
          iconClass = "rich-pmenu-group-self-icon rich-pmenu-top-group-self-icon";
       
View Full Code Here

TOP

Related Classes of org.richfaces.component.UIPanelMenuGroup

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.