Package org.richfaces.component

Examples of org.richfaces.component.UIPanelMenu


  }
 
  private void image(FacesContext context, UIComponent component, String id)throws IOException {
    ResponseWriter writer = context.getResponseWriter();

    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 = "";
View Full Code Here


  }

  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

  }
 
  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

    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";
       
      }
     
      if(align.equals(parentMenu.getIconGroupPosition())){
        if(iconClassAttr != null){
          iconClass = iconClass.equals("") ? ("rich-pmenu-group-self-icon " + iconClassAttr): (iconClass + " " + iconClassAttr);
       
      } 
    }
View Full Code Here

    }
    return  "";
  }

  public boolean queryAndMarkSelection(FacesContext context, UIComponent component){
    UIPanelMenu parentMenu = findMenu(component);
    PanelMenuState panelMenuState = PanelMenuRendererHelper.getOrCreateState(context, parentMenu);
    return panelMenuState.queryAndMarkSelection(getName(component));
  }
View Full Code Here

   
  }
 
  public void insertImage(FacesContext context, UIComponent component, Object data) throws IOException {
    String from = (String)data;
    UIPanelMenu panelMenu = findMenu(component);
    if(panelMenu == null){
      return;
    }
    String align = "";
    UIPanelMenuItem panelMenuItem = (UIPanelMenuItem)component;
    boolean isTopLevel = isTopLevel(panelMenuItem);
   
    if (isTopLevel){
      align = panelMenu.getIconItemTopPosition();
    } else {
      align = panelMenu.getIconItemPosition();
    }
   
    if (null == align || "".equals(align)) {
      align = "left";
    }
View Full Code Here

  }
 
  private void image(FacesContext context, UIComponent component, String from)
      throws IOException{
   
    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();
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();
View Full Code Here

  }
 
  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();
View Full Code Here

TOP

Related Classes of org.richfaces.component.UIPanelMenu

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.