Start line:  
End line:  

Snippet Preview

Snippet HTML Code

Stack Overflow Questions
 package org.richfaces.renderkit.html;
 
 
 import  javax.faces.context.FacesContext;
 import  javax.faces.context.ResponseWriter;
 
import  org.richfaces.renderkit.util.PanelIcons;
import  org.richfaces.renderkit.util.PanelIcons.State;
    PanelMenuGroupHeaderRenderer(String cssClassPrefix) {
        super("label"cssClassPrefix"rf-pm-ico");
    }
    private PanelIcons.State getState(AbstractPanelMenuGroup group) {
        if (group.isTopItem()) {
            return PanelMenuItemRenderer.isParentPanelMenuDisabled(group) || group.isDisabled() ? State.headerDisabled
                : State.header;
        } else {
            return PanelMenuItemRenderer.isParentPanelMenuDisabled(group) || group.isDisabled() ? State.commonDisabled
                : State.common;
        }
    }
    protected void encodeHeaderLeftIcon(ResponseWriter writer, FacesContext contextAbstractPanelMenuGroup group)
        throws IOException {
        String iconCollapsed = PanelMenuItemRenderer.isParentPanelMenuDisabled(group) || group.isDisabled() ? group
            .getLeftDisabledIcon() : group.getLeftCollapsedIcon();
        String iconExpanded = PanelMenuItemRenderer.isParentPanelMenuDisabled(group) || group.isDisabled() ? group
            .getLeftDisabledIcon() : group.getLeftExpandedIcon();
        if (iconCollapsed == null || iconCollapsed.trim().length() == 0) {
            iconCollapsed = PanelIcons.transparent.toString();
        }
        if (iconExpanded == null || iconExpanded.trim().length() == 0) {
            iconExpanded = PanelIcons.transparent.toString();
        }
        encodeTdIcon(writercontext, HtmlUtil.concatClasses( + "-ico"group.getLeftIconClass()), iconCollapsed,
            iconExpandedgetState(group));
    }
    protected void encodeHeaderRightIcon(ResponseWriter writer, FacesContext contextAbstractPanelMenuGroup group)
        throws IOException {
        String iconCollapsed = PanelMenuItemRenderer.isParentPanelMenuDisabled(group) || group.isDisabled() ? group
            .getRightDisabledIcon() : group.getRightCollapsedIcon();
        String iconExpanded = PanelMenuItemRenderer.isParentPanelMenuDisabled(group) || group.isDisabled() ? group
            .getRightDisabledIcon() : group.getRightExpandedIcon();
        if (iconCollapsed == null || iconCollapsed.trim().length() == 0) {
            iconCollapsed = PanelIcons.transparent.toString();
        }
        if (iconExpanded == null || iconExpanded.trim().length() == 0) {
            iconExpanded = PanelIcons.transparent.toString();
        }
        // TODO nick - should this be "-ico-exp"? also why expanded icon state is connected with right icon alignment?
        encodeTdIcon(writercontext, HtmlUtil.concatClasses( + "-exp-ico"group.getRightIconClass()),
            iconCollapsediconExpandedgetState(group));
    }
New to GrepCode? Check out our FAQ X