SubMenu menu = (SubMenu) def;
subMenus.put(menu.getCamelCaseName(), menu);
menuElements.put(menu.getCamelCaseName(), menu);
}
else if (def instanceof MenuItem){
MenuItem item = (MenuItem) def;
menuItems.put(item.getCamelCaseName(), item);
menuElements.put(item.getCamelCaseName(), item);
}
else if (def instanceof Separator){
Separator sep = (Separator) def;
separators.put(sep.getCamelCaseName(), sep);
menuElements.put(sep.getCamelCaseName(), sep);