code: public void setSelectedMenuItems(final List<? extends MenuItemSelectable> selectedItems) {
  		MenuModel model = getOrCreateComponentModel();
  		if (selectedItems == null || selectedItems.isEmpty()) {
  			model.selectedMenuItems = null;
  		} else {
  			List<MenuItemSelectable> items = new ArrayList<>();
  			for (MenuItemSelectable item : selectedItems) {
  				if (item.isSelectAllowed()) {
  					items.add(item);
  				}
  			}
  			if (items.isEmpty()) {
  				model.selectedMenuItems = null;
  			} else {
  				model.selectedMenuItems = items;
  			}
  		}
  	}
docs: Sets the selected items (WMenuItems or WSubMenus, depending on the menu type).
  
  @param selectedItems the selected items.