Package org.richfaces.component

Examples of org.richfaces.component.UIPanelMenuGroup


  }
 
  protected void doDecode(FacesContext context, UIComponent component) {
    String clientId = component.getClientId(context);
    Map 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();
      }
    }
   
    String defaultIconNodeOpened = null;
   
    if(isTopLevel){
      defaultIconNodeOpened = panelMenu.getIconExpandedTopGroup();
      if(defaultIconNodeOpened == null || defaultIconNodeOpened.equals("")){
        defaultIconNodeOpened = panelMenu.getIconExpandedGroup();
      }
    } else {
      defaultIconNodeOpened = panelMenu.getIconExpandedGroup();
    }

    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

  public String getHideStyle(FacesContext context, UIComponent component) {
    if (!(component.getParent() instanceof UIPanelMenu)) {
      CSSFormat format = new CSSFormat();
      format.add("display", "none");
      if(component.getParent() instanceof UIPanelMenuGroup) {
        UIPanelMenuGroup parent = (UIPanelMenuGroup)component.getParent();
        PanelMenuGroupRenderer renderer = (PanelMenuGroupRenderer) context.getRenderKit().getRenderer(parent.getFamily(), parent.getRendererType());
        try {
          if ( renderer.isOpened(context, parent) ){
            return "";
          } else
            return format.toString();
View Full Code Here

 
  protected boolean isParentDisabled(UIComponent component){
    boolean returnValue = false;
    UIComponent parent = component.getParent();
    if(parent instanceof UIPanelMenuGroup){
      UIPanelMenuGroup parentGroup = (UIPanelMenuGroup)parent;
      if(parentGroup.isDisabled()){
        returnValue = true;
      } else {
        returnValue = isParentDisabled(parentGroup);
      }
    }
View Full Code Here

      parentMode = "server";
    if (null == parentExpandMode || "".equals(parentExpandMode))
      parentExpandMode = "none";
    String mode = "none";
    if (component instanceof UIPanelMenuGroup) {
      UIPanelMenuGroup group = (UIPanelMenuGroup) component;
      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()))
View Full Code Here

  public String getHideStyle(FacesContext context, UIComponent component) {
    if (!(component.getParent() instanceof UIPanelMenu)) {
      CSSFormat format = new CSSFormat();
      format.add("display", "none");
      if(component.getParent() instanceof UIPanelMenuGroup) {
        UIPanelMenuGroup parent = (UIPanelMenuGroup)component.getParent();
        PanelMenuGroupRenderer renderer = (PanelMenuGroupRenderer) context.getRenderKit().getRenderer(parent.getFamily(), parent.getRendererType());
        try {
          if ( renderer.isOpened(context, parent) ){
            return "";
          } else
            return format.toString();
View Full Code Here

 
  protected boolean isParentDisabled(UIComponent component){
    boolean returnValue = false;
    UIComponent parent = component.getParent();
    if(parent instanceof UIPanelMenuGroup){
      UIPanelMenuGroup parentGroup = (UIPanelMenuGroup)parent;
      if(parentGroup.isDisabled()){
        returnValue = true;
      } else {
        returnValue = isParentDisabled(parentGroup);
      }
    }
View Full Code Here

      parentMode = "server";
    if (null == parentExpandMode || "".equals(parentExpandMode))
      parentExpandMode = "none";
    String mode = "none";
    if (component instanceof UIPanelMenuGroup) {
      UIPanelMenuGroup group = (UIPanelMenuGroup) component;
      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()))
View Full Code Here

 
 
  protected void setProperties(UIComponent component) {
    super.setProperties(component);
   
    UIPanelMenuGroup panelMenu = (UIPanelMenuGroup) component;
   
    if (_value != null) {
      if (_value.isLiteralText()) {
        try {
          panelMenu.setExpanded(Boolean.parseBoolean(_value.getExpressionString()));
        } catch (ELException e) {
          throw new FacesException(e);
        }
      } else {
        component.setValueExpression("value", _value);
      }
    }else{
      panelMenu.setExpanded(false)
   
  }
View Full Code Here

 
  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

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.