private void addSubMenu(final Vector items, final String menuTitle,
final int ordering) {
final int size = items.size();
if (size > 0) {
final SubMenu subMenu =
new SubMenu(null, menuTitle, ordering, Integer.MAX_VALUE);
for (int i = size - 1; i >= 0; --i) {
final Object obj = items.elementAt(i);
if (obj instanceof MenuItem) {
subMenu.add((MenuItem) obj);
}
}
addMenuItem(subMenu.getMenuItem());
}
}