private int addMenuEntrys(StringBuilder sb, String var,
FacesContext facesContext, List<String> accKeyFunctions, UIComponent component, boolean warn, int index)
throws IOException {
for (Object o : component.getChildren()) {
UIComponent entry = (UIComponent) o;
if (entry instanceof UICommand) {
addMenuEntry(sb, var, facesContext, accKeyFunctions, (UICommand) entry);
} else if (entry instanceof UIMenuSeparator) {
addMenuSeparator(sb, var);
} else if (entry instanceof UIMenu) {
index = addMenu(sb, var, facesContext, accKeyFunctions, (UIPanel) entry, index);
} else if (entry instanceof UIForm) {
index = addMenuEntrys(sb, var, facesContext, accKeyFunctions, entry, warn, index);
} else if (warn) {
LOG.error("Illegal UIComponent class in menuBar: "
+ entry.getClass().getName());
}
}
return index;
}