*
* @param entryWidget the entry widget whose children should be added to the submenu
*/
protected void addSubmenu(ChoiceMenuEntryWidget entryWidget) {
ChoiceMenuEntryBean menuEntry = entryWidget.getEntryBean();
AsyncCallback<ChoiceMenuEntryBean> selectHandler = entryWidget.getSelectHandler();
AttributeChoiceWidget choiceWidget = entryWidget.getAttributeChoiceWidget();
ChoiceSubmenu submenu = new ChoiceSubmenu(menuEntry);
submenu.positionDeferred(entryWidget);
choiceWidget.getSubmenuPanel().add(submenu);
m_submenus.add(submenu);
for (ChoiceMenuEntryBean subEntry : menuEntry.getChildren()) {
submenu.addChoice(createMenuEntryWidget(
entryWidget.getWidgetService(),
subEntry,
selectHandler,
choiceWidget,