use of com.haulmont.cuba.gui.components.mainwindow.SideMenu in project cuba by cuba-platform.
the class SideMenuBuilder method createSubMenu.
protected void createSubMenu(Window webWindow, SideMenu menu, SideMenu.MenuItem vItem, MenuItem parentItem, UserSession session) {
if (parentItem.isPermitted(session)) {
for (MenuItem child : parentItem.getChildren()) {
if (child.isSeparator()) {
continue;
}
if (child.isPermitted(session)) {
SideMenu.MenuItem menuItem = menu.createMenuItem(child.getId(), menuConfig.getItemCaption(child.getId()));
assignDescription(menuItem, child);
assignIcon(menuItem, child);
assignStyleName(menuItem, child);
if (child.getChildren().isEmpty()) {
menuItem.setCommand(createMenuBarCommand(child));
assignShortcut(webWindow, menuItem, child);
vItem.addChildItem(menuItem);
} else {
createSubMenu(webWindow, menu, menuItem, child, session);
assignExpanded(menuItem, child);
if (!isMenuItemEmpty(menuItem)) {
vItem.addChildItem(menuItem);
}
}
}
}
}
}