public ExtendedMenuItem getMenuItem(String[] path) {
ExtendedMenuBar curMenu = menu;
int l = path.length - 1;
for (int i=0; i<path.length; i++) {
String title = path[i];
ExtendedMenuItem item = curMenu.getItem(title);
if (i == l || item == null) {
return item;
} else {
if (item.getSubMenu() != null) {
curMenu = (ExtendedMenuBar) item.getSubMenu();
} else {
return null;
}
}
}