return (UIPanelMenu) parent;
}
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();
} catch (IOException e) {
e.printStackTrace();
}
} else return format.toString();
}
return "";
}