ConcreteMenu parentMenu = getCurrentMenu();
// May appear in menus or menu groups.
// @todo later could use an interface common to the two target classes
if (parentMenu != null) {
ConcreteMenuItem item = new ConcreteMenuItem(
new ConcreteElementDetails(),
new ConcreteMenuLabel(
null,
new ConcreteMenuText()));
parentMenu.add(item);
push(item);
} else {
ConcreteMenuItemGroup parentGroup = getCurrentMenuItemGroup();
if (parentGroup != null) {
ConcreteMenuItem item = new ConcreteMenuItem(
new ConcreteElementDetails(),
new ConcreteMenuLabel(
null,
new ConcreteMenuText()));
parentGroup.add(item);