Examples of UIPanelMenuGroup


Examples of org.richfaces.component.UIPanelMenuGroup

  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

Examples of org.richfaces.component.UIPanelMenuGroup

    }
   
  }
 
  public boolean isOpened(FacesContext context, UIComponent component)throws IOException {
    UIPanelMenuGroup group = (UIPanelMenuGroup)component;
   
    Boolean value = (Boolean)group.getValue();
    if (value != null) {
      return value.booleanValue();
    } else {
      boolean isParentDisabled = isParentDisabled(component);
      if(component instanceof UIPanelMenuGroup){
View Full Code Here

Examples of org.richfaces.component.UIPanelMenuGroup

    }
    return false;
  }

  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");
    }
    if(isSelected(context, component)){
View Full Code Here

Examples of org.richfaces.component.UIPanelMenuGroup

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

Examples of org.richfaces.component.UIPanelMenuGroup

      result = "dr-pmenu-group";
    return result;
  }
 
  public boolean isSelected(FacesContext context, UIComponent component){
    UIPanelMenuGroup group = (UIPanelMenuGroup)component;
    UIPanelMenu parentMenu = findMenu(group);
    return group.getName().equals(parentMenu.getSelectedName());
  }
View Full Code Here

Examples of org.richfaces.component.UIPanelMenuGroup

        Application application = FacesContext.getCurrentInstance().getApplication();

        menu = (UIPanelMenu) application.createComponent(fc, UIPanelMenu.COMPONENT_TYPE, "org.richfaces.PanelMenuRenderer");

        UIPanelMenuGroup group = (UIPanelMenuGroup) application.createComponent(fc, UIPanelMenuGroup.COMPONENT_TYPE,
            "org.richfaces.PanelMenuGroupRenderer");

        group.setLabel("group1");
        group.setId("gr1");

        UIPanelMenuItem item = (UIPanelMenuItem) application.createComponent(fc, UIPanelMenuItem.COMPONENT_TYPE,
            "org.richfaces.PanelMenuItemRenderer");

        item.setLabel("item1");
        item.setId("itm1");

        group.getChildren().add(item);

        item = (UIPanelMenuItem) application.createComponent(fc, UIPanelMenuItem.COMPONENT_TYPE,
            "org.richfaces.PanelMenuItemRenderer");

        item.setLabel("item2");
        item.setId("itm2");

        group.getChildren().add(item);
        menu.getChildren().add(group);

        group = (UIPanelMenuGroup) application.createComponent(fc, UIPanelMenuGroup.COMPONENT_TYPE,
            "org.richfaces.PanelMenuGroupRenderer");

        group.setLabel("group2");
        group.setId("gr2");

        item = (UIPanelMenuItem) application.createComponent(fc, UIPanelMenuItem.COMPONENT_TYPE,
            "org.richfaces.PanelMenuItemRenderer");

        item.setLabel("item3");
        item.setId("itm3");

        group.getChildren().add(item);

        item = (UIPanelMenuItem) application.createComponent(fc, UIPanelMenuItem.COMPONENT_TYPE,
            "org.richfaces.PanelMenuItemRenderer");

        item.setLabel("item4");
        item.setId("itm4");

        group.getChildren().add(item);
        menu.getChildren().add(group);

        item = (UIPanelMenuItem) application.createComponent(fc, UIPanelMenuItem.COMPONENT_TYPE,
            "org.richfaces.PanelMenuItemRenderer");
View Full Code Here

Examples of org.richfaces.component.UIPanelMenuGroup

        Application application = FacesContext.getCurrentInstance().getApplication();

        menu = (UIPanelMenu) application.createComponent(fc, UIPanelMenu.COMPONENT_TYPE, "org.richfaces.PanelMenuRenderer");

        UIPanelMenuGroup group = (UIPanelMenuGroup) application.createComponent(fc, UIPanelMenuGroup.COMPONENT_TYPE,
            "org.richfaces.PanelMenuGroupRenderer");

        group.setLabel("group1");
        group.setId("gr1");

        UIPanelMenuItem item = (UIPanelMenuItem) application.createComponent(fc, UIPanelMenuItem.COMPONENT_TYPE,
            "org.richfaces.PanelMenuItemRenderer");

        item.setLabel("item1");
        item.setId("itm1");

        group.getChildren().add(item);

        item = (UIPanelMenuItem) application.createComponent(fc, UIPanelMenuItem.COMPONENT_TYPE,
            "org.richfaces.PanelMenuItemRenderer");

        item.setLabel("item2");
        item.setId("itm2");

        group.getChildren().add(item);
        menu.getChildren().add(group);

        group = (UIPanelMenuGroup) application.createComponent(fc, UIPanelMenuGroup.COMPONENT_TYPE,
            "org.richfaces.PanelMenuGroupRenderer");

        group.setLabel("group2");
        group.setId("gr2");

        item = (UIPanelMenuItem) application.createComponent(fc, UIPanelMenuItem.COMPONENT_TYPE,
            "org.richfaces.PanelMenuItemRenderer");

        item.setLabel("item3");
        item.setId("itm3");

        group.getChildren().add(item);

        item = (UIPanelMenuItem) application.createComponent(fc, UIPanelMenuItem.COMPONENT_TYPE,
            "org.richfaces.PanelMenuItemRenderer");

        item.setLabel("item4");
        item.setId("itm4");

        group.getChildren().add(item);
        menu.getChildren().add(group);

        item = (UIPanelMenuItem) application.createComponent(fc, UIPanelMenuItem.COMPONENT_TYPE,
            "org.richfaces.PanelMenuItemRenderer");
View Full Code Here

Examples of org.richfaces.component.UIPanelMenuGroup

 
  private void setExpandedIfNeeded(FacesContext context,UIComponent child,StringBuffer buffer){
    if(child instanceof UIPanelMenuItem){
      buffer.append(",false");
    } else {
      UIPanelMenuGroup group = (UIPanelMenuGroup)child;
      if(group.getValue() != null){
        buffer.append(",").append(group.getValue().toString());
      } else {
        PanelMenuGroupRenderer r =  (PanelMenuGroupRenderer)context.getRenderKit().getRenderer(group.getFamily(), group.getRendererType());
        boolean isNodeOpened;
        try {
          isNodeOpened = r.isOpened(context, child);
        } catch (IOException e) {
          isNodeOpened = false;
View Full Code Here

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();
        }
      }
     
      String defaultIconNodeOpened = isTopLevel ? panelMenu.getIconExpandedTopGroup() : panelMenu.getIconExpandedGroup();
     
      if(isTopLevel){
        defaultIconNodeOpened = panelMenu.getIconExpandedTopGroup();
        if(defaultIconNodeOpened == null || defaultIconNodeOpened.equals("")){
          defaultIconNodeOpened = panelMenu.getIconExpandedGroup();
        }
      } else {
        defaultIconNodeOpened = panelMenu.getIconExpandedGroup();
      }

      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

Examples of org.richfaces.component.UIPanelMenuGroup

 
  private void setExpandedIfNeeded(FacesContext context,UIComponent child,StringBuffer buffer){
    if(child instanceof UIPanelMenuItem){
      buffer.append(",false");
    } else {
      UIPanelMenuGroup group = (UIPanelMenuGroup)child;
      if(group.getValue() != null){
        buffer.append(",").append(group.getValue().toString());
      } else {
        PanelMenuGroupRenderer r =  (PanelMenuGroupRenderer)context.getRenderKit().getRenderer(group.getFamily(), group.getRendererType());
        boolean isNodeOpened;
        try {
          isNodeOpened = r.isOpened(context, child);
        } catch (IOException e) {
          isNodeOpened = false;
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.