for (int sectionIndex = 0; sectionIndex < sections.size(); sectionIndex++) {
MenuSection section = sections.get(sectionIndex);
List<MenuItemInfo> menuItemInfoList = section.getMenuItemInfoList();
for (MenuItemInfo info : menuItemInfoList) {
MenuItemType type = info.getType();
if (type == MenuItemType.SUBMENU) {
ContextAwareMenu submenu = ActionManager.getMenu(info.getCommandKey(), context);
if (submenu == null) continue;
// Add a separator between sections