@Override protected String getStyleClass(UIComponent component) { AbstractPanelMenuItem menuItem = (AbstractPanelMenuItem) component; return concatClasses( getCssClass(menuItem, ""), attributeAsString(component, "styleClass"), PanelMenuItemRenderer.isParentPanelMenuDisabled(menuItem) || menuItem.isDisabled() ? getCssClass(menuItem, "-dis") : "", (menuItem.isActiveItem() ? getCssClass(menuItem, "-sel") : ""), PanelMenuItemRenderer.isParentPanelMenuDisabled(menuItem) || menuItem.isDisabled() ? attributeAsString(component, "disabledClass") : ""); }
private void encodeHeaderGroupLeftIcon( ResponseWriter writer, FacesContext context, AbstractPanelMenuItem menuItem, String classPrefix) throws IOException { String icon = PanelMenuItemRenderer.isParentPanelMenuDisabled(menuItem) || menuItem.isDisabled() ? menuItem.getLeftDisabledIcon() : menuItem.getLeftIcon(); String cssClasses = concatClasses(classPrefix + "-ico", menuItem.getLeftIconClass()); if (icon == null || icon.trim().length() == 0) { icon = PanelIcons.transparent.toString(); } encodeTdIcon(writer, context, cssClasses, icon, getState(menuItem)); }
@Override protected Map<String, Object> getScriptObjectOptions( FacesContext context, UIComponent component) { AbstractPanelMenuItem panelMenuItem = (AbstractPanelMenuItem) component; Map<String, Object> options = new HashMap<String, Object>(); // TODO nick - ajax options should not be rendered in client mode options.put("ajax", getAjaxOptions(context, panelMenuItem)); options.put( "disabled", PanelMenuItemRenderer.isParentPanelMenuDisabled(panelMenuItem) || panelMenuItem.isDisabled()); options.put("mode", panelMenuItem.getMode()); options.put("name", panelMenuItem.getName()); options.put("selectable", panelMenuItem.isSelectable()); options.put("unselectable", panelMenuItem.isUnselectable()); options.put("stylePrefix", getCssClass(panelMenuItem, "")); addEventOption(context, panelMenuItem, options, UNSELECT); addEventOption(context, panelMenuItem, options, SELECT); addEventOption(context, panelMenuItem, options, BEFORE_SELECT); return options; }
private PanelIcons.State getState(AbstractPanelMenuItem item) { return PanelMenuItemRenderer.isParentPanelMenuDisabled(item) || item.isDisabled() ? State.commonDisabled : State.common; }