boolean isTopLevel = isTopLevel(component);
final String PANEL_MENU_SPACER_ICON = getIconByType(PANEL_MENU_SPACER_ICON_NAME, isTopLevel,context, component);
if(component instanceof UIPanelMenuItem){
UIPanelMenuItem item = (UIPanelMenuItem)component;
String defaultItemIcon = null;
String defaultItemIconSrc = null;
String customItemIcon = null;
String customIconSource = null;
if(isTopLevel){
if(item.isDisabled()){
defaultItemIcon = panelMenu.getIconTopDisabledItem();
} else {
defaultItemIcon = panelMenu.getIconTopItem();
}
if(defaultItemIcon == null || defaultItemIcon.equals("")){
if(item.isDisabled()){
defaultItemIcon = panelMenu.getIconDisabledItem();
} else {
defaultItemIcon = panelMenu.getIconItem();
}
}
} else {
//isTopLevel == false
if(defaultItemIcon == null || defaultItemIcon.equals("")){
if(item.isDisabled()){
defaultItemIcon = panelMenu.getIconDisabledItem();
} else {
defaultItemIcon = panelMenu.getIconItem();
}
}
}
if(defaultItemIcon != null && defaultItemIcon.equals("none")){
defaultItemIconSrc = PANEL_MENU_SPACER_ICON;
} else {
defaultItemIconSrc = getIconByType(defaultItemIcon, isTopLevel,context, component);
}
customItemIcon = item.isDisabled() ? item.getIconDisabled() : item.getIcon();
if(customItemIcon != null && customItemIcon.equals("none")){
customIconSource = PANEL_MENU_SPACER_ICON;
} else {
customIconSource = getIconByType(customItemIcon, isTopLevel,context, component);
}