Add all menus at once.

@param menuItems
the new menu items
@return this {@link MenuItem}
340781
public MenuItem setMenuItems(final List<MenuItem> menuItems)
	{
		this.children.clear();
		this.children.addAll(menuItems);
		return this;
	}
127681
public boolean addAll(Collection<T> items)
	{
		boolean wasAllAdded = true;
		for (T item : items)
		{
			if(!add(item))
				wasAllAdded = false;
		}
		
		return wasAllAdded;
	}
112040
public function addMenu(Menu $menu)
    {
        $menu->setArticle($this);
        $this->menus[] = $menu;

        return $this;
    }
1174093
public void addOrUpdateItem(int parentId, MenuItem item) {
        synchronized (subMenuItems) {
            getSubMenuById(parentId).ifPresent(subMenu-> {
                if(getMenuItems(subMenu).stream().anyMatch(it-> it.getId() == item.getId())) {
                    replaceMenuById(asSubMenu(subMenu), item);
                }
                else {
                    addMenuItem(asSubMenu(subMenu), item);
                }
            });
        }
    }
533662
public static <T> boolean addAll(Collection<T> self, Iterable<T> items) {
        boolean changed = false;
        for (T next : items) {
            if (self.add(next)) changed = true;
        }
        return changed;
    }
1152623
public CmsTreeNode<I_CmsContextMenuItem> buildAll(List<I_CmsContextMenuItem> availableItems) {

        CmsTreeNode<I_CmsContextMenuItem> result = buildTree(availableItems);
        removeEmptySubtrees(result);
        return result;

    }
606931
public function addMenus(array $items)
    {
        foreach ($items as $item) {
            /// XXX ugly crutch, but no better ideas for the moment
            $config = $item['menu'];
            if (is_array($config) && empty($config['class'])) {
                continue;
            }

            $menu = Yii::createObject($item['menu']);
            $this->addItems($menu->getItems(), isset($item['where']) ? $item['where'] : null);
        }
    }
1117138
public function setMenuItem(MenuItemInterface $menuItem)
    {
        $menuItem->setPage($this);
        $this->menuItem = $menuItem;

        return $this;
    }
589632
public FastAdapterDialog<Item> add(int position, List<Item> items) {
        mItemAdapter.add(position, items);
        return this;
    }
399775
public void moveItem(SubMenuItem parent, MenuItem newItem, MoveType moveType) {
        synchronized (subMenuItems) {
            ArrayList<MenuItem> items = subMenuItems.get(parent);
            int idx = items.indexOf(newItem);
            if(idx < 0) return;

            items.remove(idx);

            idx = (moveType == MoveType.MOVE_UP)? --idx : ++idx;
            if(idx<0) idx=0;

            if(idx>=items.size()) {
                items.add(newItem);
            }
            else {
                items.add(idx, newItem);
            }
        }
    }
678217
public DrawerView addItems(List<DrawerItem> items) {
        mAdapter.setNotifyOnChange(false);
        for (DrawerItem item : items) {
            if (item.getId() <= 0) {
                item.setId(System.nanoTime() * 100 + Math.round(Math.random() * 100));
            }
            for (DrawerItem oldItem : mAdapter.getItems()) {
                if (oldItem.getId() == item.getId()) {
                    mAdapter.remove(oldItem);
                    break;
                }
            }

            item.attachTo(mAdapter);
            mAdapter.add(item);
        }
        mAdapter.setNotifyOnChange(true);
        mAdapter.notifyDataSetChanged();
        updateList();
        return this;
    }
19065
public ContextMenuItem addItem(String caption) {

        ContextMenuItemState itemState = getState().addChild(caption, getNextId());

        ContextMenuItem item = new ContextMenuItem(null, itemState);
        m_items.put(itemState.getId(), item);

        return item;
    }
630373
public void setItems (Array<T> newItems) {
		items.clear();
		items.addAll(newItems);
		currentIndex = 0;
		invalidateDataSet();
	}
1129818
@SafeVarargs
    public final void addAll(T... items) {
        final int length = items.length;
        if (length == 0) {
            return;
        }
        synchronized (mLock) {
            final int position = getItemCount();
            Collections.addAll(mObjects, items);
            notifyItemRangeInserted(position, length);
        }
    }
406605
public JMenuItem addMenuItem(JMenu menu, String actionKey, char[] rgChars)
    {
        JMenuItem menuItem;
        Action action = (Action)this.get(actionKey);
        if (action == null)
            return null;
        menu.add(menuItem = new JMenuItem(action));
        char firstChar = ActionManager.getFirstChar((String)menuItem.getAction().getValue(Action.NAME), rgChars, false);
        if (firstChar != NO_CHAR)
            menuItem.setMnemonic(firstChar);
        menuItem.setHorizontalTextPosition(JButton.RIGHT);

        return menuItem;
    }
616086
function addItem(item = {}) {
    if (!item.id) {
        console.warn('Cannot add menuitem. A unique identifier is required for the menuitem to work correctly.');
        return;
    }
    let el = doc.createElement('menuItem');
    // assign unique id
    item.attributes = _.assign({}, item.attributes, {
        id: item.id
    });
    // add all attributes
    setAttributes(el, item.attributes);
    // add title
    el.innerHTML = `<title>${(_.isFunction(item.name) ? item.name() : item.name)}</title>`;
    // add page reference
    el.page = item.page;
    // appends to the menu
    menuBarEl.insertBefore(el, null);
    // cache for later use
    itemsCache[item.id] = el;

    return el;
}
1341664
public void addSubItem(WebMenuItem item){
		if (subMenu == null){
			subMenu = new ArrayList<WebMenuItem>();
		}
		subMenu.add(item);
	}