private void getChildMenuItems(final List<MenuItem> items, final boolean recurse, final MenuContainer container) {

		for (MenuItem item : container.getMenuItems()) {
			items.add(item);
			if (recurse && item instanceof MenuContainer) {
				getChildMenuItems(items, recurse, (MenuContainer) item);
			}
		}
	}
private void getChildMenuItems ( final List < MenuItem > items , final boolean recurse , final MenuContainer container ) { for ( MenuItem item : container . getMenuItems ( ) ) { items . add ( item ) ; if ( recurse && item instanceof MenuContainer ) { getChildMenuItems ( items , recurse , ( MenuContainer ) item ) ; } } }
@param items the list of menu items
@param recurse true if recurse into child items that are menu containers
@param container the current container