Adds a child item.<p>

@param itemCaption the caption
@param itemId the id

@return the item state
164959
public ContextMenuItemState addChild(String itemCaption, String itemId) {

        ContextMenuItemState rootItem = new ContextMenuItemState();
        rootItem.setCaption(itemCaption);
        rootItem.setId(itemId);

        m_rootItems.add(rootItem);

        return rootItem;
    }
1058917
public void add(Item item)
    {
        Item innerItem = trie.get(item.key);
        if (innerItem == null)
        {
            innerItem = item;
            trie.put(innerItem.key, innerItem);
        }
        else
        {
            innerItem.combine(item);
        }
    }
668260
@SafeVarargs
    public final FastItemAdapter<Item> add(int position, Item... items) {
        getItemAdapter().add(position, items);
        return this;
    }
343822
@NonNull
    public static <T> ItemBinding<T> of(int variableId, @LayoutRes int layoutRes) {
        return new ItemBinding<T>(null).set(variableId, layoutRes);
    }
565457
public ProductPartitionNode addChild(ProductDimension childDimension) {
    ProductPartitionNode newChild = new ProductPartitionNode(this, childDimension, null,
        children.comparator());
    Preconditions.checkArgument(isSubdivision(),
        "Parent node is not a SUBDIVISION. Call asSubdivision before adding children to a node.");
    if (children.containsKey(childDimension)) {
      throw new IllegalArgumentException(
          String.format("A child with dimension %s already exists", toString(childDimension)));
    }
    children.put(childDimension, newChild);
    return newChild;
  }
542493
public void appendChild(final Node child) {
        if (child instanceof Level) {
            // Append the level
            levels.add((Level) child);
            nodes.add(child);
            if (child.getParent() != null) {
                child.removeParent();
            }
            child.setParent(this);
        } else if (child instanceof SpecTopic) {
            appendSpecTopic((SpecTopic) child);
        } else if (child instanceof CommonContent) {
            // Append the common content
            commonContents.add((CommonContent) child);
            nodes.add(child);
            if (child.getParent() != null) {
                child.removeParent();
            }
            child.setParent(this);
        } else {
            nodes.add(child);
            if (child.getParent() != null) {
                child.removeParent();
            }
            child.setParent(this);
        }
    }
1219625
public static com.liferay.commerce.model.CommerceShipmentItem addCommerceShipmentItem(
		com.liferay.commerce.model.CommerceShipmentItem commerceShipmentItem) {
		return getService().addCommerceShipmentItem(commerceShipmentItem);
	}
880761
@SuppressWarnings("unchecked")
    void onItemClick(ItemClickEvent event) {

        if (!event.isCtrlKey() && !event.isShiftKey()) {
            // don't interfere with multi-selection using control key
            if (event.getButton().equals(MouseButton.RIGHT) || (event.getPropertyId() == null)) {
                CmsUUID itemId = (CmsUUID)event.getItemId();
                Set<CmsUUID> value = (Set<CmsUUID>)getValue();
                if (value == null) {
                    select(itemId);
                } else if (!value.contains(itemId)) {
                    setValue(null);
                    select(itemId);
                }
                m_menu.setEntries(getMenuEntries(), (Set<CmsUUID>)getValue());
                m_menu.openForTable(event, this);
            } else if (event.getButton().equals(MouseButton.LEFT) && PROP_NAME.equals(event.getPropertyId())) {
                Item item = event.getItem();
                CmsUUID id = (CmsUUID)item.getItemProperty(PROP_ID).getValue();
                m_manager.openSubView(
                    A_CmsWorkplaceApp.addParamToState(CmsProjectManager.PATH_NAME_FILES, "projectId", id.toString()),
                    true);
            }
        }
    }
302691
public void addChild(CmsGalleryTreeEntry child) {

        if (m_children == null) {
            m_children = new ArrayList<CmsGalleryTreeEntry>();
        }
        m_children.add(child);
        child.setParent(this);
    }
1149616
private void addTreeItem(
        CmsObject cms,
        CmsResource resource,
        CmsUUID parentId,
        boolean disabled,
        HierarchicalContainer container) {

        CmsResourceUtil resUtil = new CmsResourceUtil(cms, resource);
        Item resourceItem = container.getItem(resource.getStructureId());
        if (resourceItem == null) {
            resourceItem = container.addItem(resource.getStructureId());
        }

        // use the root path as name in case of the root item
        String resName = parentId == null ? resource.getRootPath() : resource.getName();
        resourceItem.getItemProperty(CmsResourceTableProperty.PROPERTY_RESOURCE_NAME).setValue(resName);
        resourceItem.getItemProperty(CmsResourceTableProperty.PROPERTY_STATE).setValue(resource.getState());

        resourceItem.getItemProperty(CmsResourceTableProperty.PROPERTY_INSIDE_PROJECT).setValue(
            Boolean.valueOf(resUtil.isInsideProject()));
        resourceItem.getItemProperty(CmsResourceTableProperty.PROPERTY_RELEASED_NOT_EXPIRED).setValue(
            Boolean.valueOf(resUtil.isReleasedAndNotExpired()));
        String iconHTML = CmsResourceIcon.getTreeCaptionHTML(resName, resUtil, null, false);

        resourceItem.getItemProperty(CmsResourceTableProperty.PROPERTY_TREE_CAPTION).setValue(iconHTML);
        if (disabled) {
            resourceItem.getItemProperty(CmsResourceTableProperty.PROPERTY_DISABLED).setValue(Boolean.TRUE);
        }
        if (parentId != null) {
            container.setChildrenAllowed(parentId, true);
            container.setParent(resource.getStructureId(), parentId);
        }
    }
38474
private void onNavDrawerItemClicked(final int itemId) {
        if (itemId == mSelectedItem) {
            mDrawerLayout.closeDrawer(GravityCompat.START);
            return;
        }

        if (isSpecialItem(itemId)) {
            goToNavDrawerItem(itemId);
        } else {
            // launch the target Activity after a short delay, to allow the close animation to play
            mHandler.postDelayed(new Runnable() {
                @Override
                public void run() {
                    goToNavDrawerItem(itemId);
                }
            }, mConfig.getLaunchDelay());

            // change the active item on the list so the user can see the item changed
            setSelectedNavDrawerItem(itemId);

            // fade out the main content
//            if (mMainContent != null && mConfig.getFadeOutDuration() != -1) {
//                mMainContent.animate().alpha(0).setDuration(mConfig.getFadeOutDuration());
//            }
        }

        mDrawerLayout.closeDrawer(GravityCompat.START);
    }
71667
public Node<T> addChild(Node<T> child) {
        if (children == null) {
            children = new ArrayList<Node<T>>();
        }
        child.parent = this;
        children.add(child);

        return child;
    }
1364868
public void addTreeItem(CmsObject cms, CmsResource resource, CmsUUID parentId) {

        List<Container.Filter> filters = Lists.newArrayList(getContainerFilters());

        // getItem only finds an existing item if it isn't filtered out by the container
        // filters, so we temporarily remove the filters to access the complete data set
        removeAllContainerFilters();
        try {
            Item resourceItem = getItem(resource.getStructureId());
            if (resourceItem == null) {
                resourceItem = addItem(resource.getStructureId());
            }
            fillProperties(cms, resourceItem, resource, parentId);
            if (resource.isFile()) {
                setChildrenAllowed(resource.getStructureId(), false);
            }
            if (parentId != null) {
                setParent(resource.getStructureId(), parentId);
            }
        } finally {
            for (Container.Filter filter : filters) {
                addContainerFilter(filter);
            }
        }
    }
1002159
public void addChild(Command cmd)
	{
		if (cmd != null)
		{
			cmd.setContext(this);
			commands.add(cmd);
		}
	}
1316499
protected void registerItem(I item) {

        if (item.getId() != null) {
            m_items.put(item.getId(), item);
        }
        if (m_tmPrefix != null) {
            item.truncate(m_tmPrefix, m_childWidth);
        }
    }
489382
protected boolean addItem(final Suggestion suggestion) {
        SelectionEvent.fire(MaterialAutoComplete.this, suggestion);
        if (getLimit() > 0) {
            if (suggestionMap.size() >= getLimit()) {
                return false;
            }
        }

        if (suggestionMap.containsKey(suggestion)) {
            return false;
        }

        final ListItem displayItem = new ListItem();
        displayItem.setStyleName(AddinsCssName.MULTIVALUESUGGESTBOX_TOKEN);

        if (getType() == AutocompleteType.TEXT) {
            suggestionMap.clear();
            itemBox.setText(suggestion.getReplacementString());
        } else {
            final MaterialChip chip = chipProvider.getChip(suggestion);
            if (chip == null) {
                return false;
            }

            registerHandler(chip.addClickHandler(event -> {
                if (chipProvider.isChipSelectable(suggestion)) {
                    if (itemsHighlighted.contains(displayItem)) {
                        chip.removeStyleName(selectedChipStyle);
                        itemsHighlighted.remove(displayItem);
                    } else {
                        chip.addStyleName(selectedChipStyle);
                        itemsHighlighted.add(displayItem);
                    }
                }
            }));

            if (chip.getIcon() != null) {
                registerHandler(chip.getIcon().addClickHandler(event -> {
                    if (chipProvider.isChipRemovable(suggestion)) {
                        suggestionMap.remove(suggestion);
                        list.remove(displayItem);
                        itemsHighlighted.remove(displayItem);
                        ValueChangeEvent.fire(MaterialAutoComplete.this, getValue());
                        suggestBox.showSuggestionList();
                    }
                }));
            }

            suggestionMap.put(suggestion, chip);
            displayItem.add(chip);
            list.insert(displayItem, list.getWidgetCount() - 1);
        }
        return true;
    }
401758
protected void handleExpand(Object itemId) {

        I_CmsOuTreeType type = (I_CmsOuTreeType)getItem(itemId).getItemProperty(PROP_TYPE).getValue();
        loadAndExpand(itemId, type);
    }