Package org.richfaces.component

Examples of org.richfaces.component.UIPanelMenuItem


      if (null != group.getExpandMode() && ! "".equals(group.getExpandMode()))
        mode = group.getExpandMode();
      else
        mode = parentExpandMode;
    } else if (component instanceof UIPanelMenuItem) {
      UIPanelMenuItem item = (UIPanelMenuItem) component;
      if (null != item.getMode() && ! "".equals(item.getMode()))
        mode = item.getMode();
      else
        mode = parentMode;
    }
    return mode;
  }
View Full Code Here


      if (null != group.getExpandMode() && ! "".equals(group.getExpandMode()))
        mode = group.getExpandMode();
      else
        mode = parentExpandMode;
    } else if (component instanceof UIPanelMenuItem) {
      UIPanelMenuItem item = (UIPanelMenuItem) component;
      if (null != item.getMode() && ! "".equals(item.getMode()))
        mode = item.getMode();
      else
        mode = parentMode;
    }
    return mode;
  }
View Full Code Here

    UIPanelMenu panelMenu = findMenu(component);
    if(panelMenu == null){
      return;
    }
    String align = "";
    UIPanelMenuItem panelMenuItem = (UIPanelMenuItem)component;
    boolean isTopLevel = isTopLevel(panelMenuItem);
   
    if (isTopLevel){
      align = panelMenu.getIconItemTopPosition();
    } else {
View Full Code Here

   
    UIPanelMenu panelMenu = findMenu(component);
    ResponseWriter writer = context.getResponseWriter();
    boolean isTopLevel = isTopLevel(component);   
    String iconType  = null
    UIPanelMenuItem item = (UIPanelMenuItem)component;
   
    String defaultItemIcon = null;
    String customItemIcon = null;
   
    if(isTopLevel){
      if(item.isDisabled()){
        defaultItemIcon = panelMenu.getIconTopDisabledItem();
      } else {
        defaultItemIcon = panelMenu.getIconTopItem();
      }
      if(defaultItemIcon == null || defaultItemIcon.equals("")){
        if(item.isDisabled()){
          defaultItemIcon = panelMenu.getIconDisabledItem();
        } else {
          defaultItemIcon = panelMenu.getIconItem();
        }
      }
    } else {
      //isTopLevel == false
      if(defaultItemIcon == null || defaultItemIcon.equals("")){
        if(item.isDisabled()){
          defaultItemIcon = panelMenu.getIconDisabledItem();
        } else {
          defaultItemIcon = panelMenu.getIconItem();
        }
      }
    }
   
    customItemIcon = item.isDisabled() ? item.getIconDisabled() : item.getIcon();
   
    if(customItemIcon == null || customItemIcon.equals("")){
      iconType = defaultItemIcon;
    } else iconType = customItemIcon;
   
View Full Code Here

  }
 
 
  public String getFullStyleClass(FacesContext context, UIComponent component) {
    StringBuffer classBuffer = new StringBuffer("");
    UIPanelMenuItem item = (UIPanelMenuItem)component;
    UIPanelMenu parentMenu = findMenu(item);
    if (!parentMenu.isDisabled() && !item.isDisabled()) {
      if (calculateLevel(item) == 0) {
        String topItemClass = parentMenu.getTopItemClass();
        if(topItemClass != null && !topItemClass.equals("")){
          classBuffer.append(topItemClass).append(" ");
        }
        classBuffer.append("rich-pmenu-top-item ");
      } else {
        String parentItemClass = parentMenu.getItemClass();
        if(parentItemClass != null && !parentItemClass.equals("")){
          classBuffer.append(parentItemClass).append(" ");
       
      } 
      String itemClass = item.getStyleClass();
      if(itemClass != null && !itemClass.equals("")){
        classBuffer.append(itemClass);
     
    } else {
      String pmDisabledItemClass = parentMenu.getDisabledItemClass();
      if (pmDisabledItemClass != null && !pmDisabledItemClass.equals("")) {
        classBuffer.append(pmDisabledItemClass).append(" ");
      }
     
      String itemDisabledClass = item.getDisabledClass();
      if (itemDisabledClass != null && !itemDisabledClass.equals("")) {
        classBuffer.append(itemDisabledClass);
      }
    } 
    return classBuffer.toString();
View Full Code Here

    return classBuffer.toString();
  }
 
  public String getFullStyle(FacesContext context, UIComponent component) {
    StringBuffer styleBuffer = new StringBuffer("");
    UIPanelMenuItem item = (UIPanelMenuItem)component;
    UIPanelMenu parentMenu = findMenu(item);
    if (!item.isDisabled()) {
      if (calculateLevel(item) == 0){
        String topItemStyle = parentMenu.getTopItemStyle();
        if (topItemStyle != null && !topItemStyle.equals("")) {
          styleBuffer.append(parentMenu.getTopItemStyle()).append(";").append(" ");;
       
      } else {
        String itemStyle = parentMenu.getItemStyle();
        if (itemStyle != null && !itemStyle.equals("")) {
          styleBuffer.append(itemStyle).append(";").append(" ");
        }
      } 
      String style = item.getStyle();
      if (style != null && !style.equals("")) {
        styleBuffer.append(item.getStyle());
     
    } else {
      String pmDisabledItemStyle = parentMenu.getDisabledItemStyle();     
      if (pmDisabledItemStyle != null && !pmDisabledItemStyle.equals("")) {
        styleBuffer.append(pmDisabledItemStyle).append(";").append(" ");;
      }
     
      String itemDisabledStyle = item.getDisabledStyle();
      if (itemDisabledStyle != null && !itemDisabledStyle.equals("")){
        styleBuffer.append(itemDisabledStyle);
     
    } 
    return styleBuffer.toString();
View Full Code Here

    return  "";
  }

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

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

   
    return iconClass;
  }
 
  public boolean isSelected(FacesContext context, UIComponent component){
    UIPanelMenuItem item = (UIPanelMenuItem)component;
    UIPanelMenu parentMenu = findMenu(item);
    return item.getName().equals(parentMenu.getSelectedName());
  }
View Full Code Here

    boolean isTopLevel = isTopLevel(component);
   
    final String PANEL_MENU_SPACER_ICON = getIconByType(PANEL_MENU_SPACER_ICON_NAME, isTopLevel,context, component);

    if(component instanceof UIPanelMenuItem){
      UIPanelMenuItem item = (UIPanelMenuItem)component;
     
      String defaultItemIcon = null;
      String defaultItemIconSrc = null;
      String customItemIcon = null;
      String customIconSource = null;
     
      if(isTopLevel){
        if(item.isDisabled()){
          defaultItemIcon = panelMenu.getIconTopDisabledItem();
        } else {
          defaultItemIcon = panelMenu.getIconTopItem();
        }
        if(defaultItemIcon == null || defaultItemIcon.equals("")){
          if(item.isDisabled()){
            defaultItemIcon = panelMenu.getIconDisabledItem();
          } else {
            defaultItemIcon = panelMenu.getIconItem();
          }
        }
      } else {
        //isTopLevel == false
        if(defaultItemIcon == null || defaultItemIcon.equals("")){
          if(item.isDisabled()){
            defaultItemIcon = panelMenu.getIconDisabledItem();
          } else {
            defaultItemIcon = panelMenu.getIconItem();
          }
        }
      }
     
      if(defaultItemIcon != null && defaultItemIcon.equals("none")){
        defaultItemIconSrc = PANEL_MENU_SPACER_ICON;
      } else {
        defaultItemIconSrc = getIconByType(defaultItemIcon, isTopLevel,context, component);
      }
     
      customItemIcon = item.isDisabled() ? item.getIconDisabled() : item.getIcon();
      if(customItemIcon != null && customItemIcon.equals("none")){
        customIconSource = PANEL_MENU_SPACER_ICON;
      } else {
        customIconSource = getIconByType(customItemIcon, isTopLevel,context, component);
      }
View Full Code Here

TOP

Related Classes of org.richfaces.component.UIPanelMenuItem

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.