Return true if at least one child of the given tree item is selected.<p>
@param item The CmsTreeItem to start the check
@return true if the given CmsTreeItem or its children is selected
503664
private boolean hasSelectedChildren(CmsTreeItem item) {

        for (String childId : m_childrens.get(item.getId())) {
            CmsTreeItem child = m_categories.get(childId);
            if (child.getCheckBox().isChecked() || hasSelectedChildren(child)) {
                return true;
            }
        }
        return false;
    }
74593
public synchronized void remove(ModuleItem item) {
        if (item == null || children == null)
            return;

        // remove from all the parents which have links to it due to aggregate data
        PmiModule removeInstance = item.getInstance();
        if (!(removeInstance instanceof PmiModuleAggregate)) {
            // recursively remove aggregate data for parents
            ModuleItem myParent = this;
            PmiModule parModule = null;
            while (myParent != null) {
                parModule = myParent.getInstance();
                // if parent is aggregate
                if (parModule != null && parModule instanceof PmiModuleAggregate)
                    ((PmiModuleAggregate) parModule).remove(removeInstance);

                myParent = myParent.getParent();
            }
        }

        // remove any children
        item._cleanChildren();

        // remove ModuleItem
        children.remove(item.getInstance().getName());

        if (myStatsWithChildren != null) {
            updateStatsTree();
        }

        //bStatsTreeNeedsUpdate = true;

        // remove mbean mapping and deactivate any CustomStats mbean
        //_cleanMBean(item);
        item.getInstance().cleanup();
        item = null;
    }
1138162
private boolean isUnchangedAndShouldBeRemoved(CmsResource item) {

        if (item.getState().isUnchanged()) {
            return !m_keepOriginalUnchangedResources || !m_originalResources.contains(item);
        }
        return false;
    }
285314
public void openWithParents(CmsTreeItem item) {

        if (item != null) {
            item.setOpen(true);
            openWithParents(item.getParentItem());
        }
    }
1062214
public boolean remove(ESigItem item) {
        boolean result = items.remove(item);
        
        if (result) {
            removed(item);
        }
        
        return result;
    }
465822
private boolean isChild(Node cn, Node cn2) {
        if (cn == cn2)
            return false;

        Queue<Node> toProcess = new LinkedList<Node>();
        toProcess.addAll(cn.getParents());

        while (!toProcess.isEmpty()) {
            Node tcn = toProcess.poll();
            if (tcn.equals(cn2))
                return true;
            Set<Node> parents = tcn.getParents();
            if (parents != null && !parents.isEmpty())
                toProcess.addAll(parents);
        }

        return false;
    }
53919
public static final <T> boolean contains(T[] array, T item)
    {
        for (T b : array)
        {
            if (b.equals(item))
            {
                return true;
            }
        }
        return false;
    }
576003
private function _isLink($item): bool
	{
		if ($item === null) {
			return true;
		} elseif (is_array($item)) {
			return !is_array(current($item));
		} else {
			throw new \InvalidArgumentException('Cms menu items is wrong in config.neon');
		}
	}
1110408
public boolean isItemSelected(final int index) {
        checkIndex(index);
        OptionElement item = selectElement.getOptions().getItem(index);
        Option option = itemMap.get(item);
        return option != null && option.isSelected();
    }
1220913
protected static boolean isChildOf(String parent, String child) {
      if (parent == null || child == null)
         return false;
      if (!child.startsWith((parent.endsWith(SEPARATOR) ? parent : parent + SEPARATOR)))
         return false;
      if (child.length() <= parent.length())
         return false;
      int from = parent.equals(SEPARATOR) ? parent.length() : parent.length() + 1;
      //  if(from-1 > child.length())
      // return false;
      String[] comps = Util.components(child.substring(from), SEPARATOR);
      return comps != null && comps.length <= 1;
   }
1059317
private void addChildrenForOUNode(CmsOrganizationalUnit item) {

        List<Object> itemsToRemove = new ArrayList<Object>();

        Collection<?> childCol = m_treeContainer.getChildren(item);
        if (childCol != null) {
            itemsToRemove.addAll(childCol);
        }

        try {
            if (m_app.isOUManagable(item.getName())) {

                List<I_CmsOuTreeType> types = m_app.getTreeTypeProvider().getTreeTypes();
                for (I_CmsOuTreeType type : types) {
                    if (!type.isValidForOu(m_cms, item.getName())) {
                        continue;
                    }
                    if (type.isOrgUnit()) {
                        continue;
                    }
                    String itemId = type.getId() + item.getName();
                    Item newItem = m_treeContainer.addItem(itemId);
                    itemsToRemove.remove(itemId);
                    if (newItem != null) {
                        newItem.getItemProperty(PROP_NAME).setValue(getIconCaptionHTML(itemId, type));
                        newItem.getItemProperty(PROP_TYPE).setValue(type);
                        m_treeContainer.setParent(itemId, item);
                        setChildrenAllowed(itemId, type.isExpandable());
                    }
                }
            }
            List<CmsOrganizationalUnit> ous = OpenCms.getOrgUnitManager().getOrganizationalUnits(
                m_cms,
                item.getName(),
                false);
            List<CmsOrganizationalUnit> webOus = new ArrayList<CmsOrganizationalUnit>();
            for (CmsOrganizationalUnit ou : ous) {
                if (m_app.isParentOfManagableOU(ou.getName())) {
                    itemsToRemove.remove(ou);
                    if (ou.hasFlagWebuser()) {
                        webOus.add(ou);
                    } else {
                        addOuToTree(ou, item);
                    }
                }
            }
            for (CmsOrganizationalUnit ou : webOus) {
                if (m_app.isParentOfManagableOU(ou.getName())) {
                    itemsToRemove.remove(ou);
                    addOuToTree(ou, item);
                }
            }
        } catch (CmsException e) {
            LOG.error("Can't read ou", e);
        }
        for (Object it : itemsToRemove) {
            m_treeContainer.removeItemRecursively(it);
        }
    }
401220
public boolean mightContain(T item) {
		BucketAndTag pos = hasher.generate(item);
		long i1 = pos.index;
		long i2 = hasher.altIndex(pos.index, pos.tag);
		bucketLocker.lockBucketsRead(i1, i2);
		try {
			if (table.findTag(i1, i2, pos.tag)) {
				return true;
			}
		} finally {
			bucketLocker.unlockBucketsRead(i1, i2);
		}
		return checkIsVictim(pos);
	}
134694
public void insertChild(CmsTreeItem item, int position) {

        m_children.insert(item, position);
        adopt(item);
    }
171525
public CmsTreeItem removeChild(final CmsTreeItem item) {

        item.setParentItem(null);
        item.setTree(null);
        if ((m_tree != null) && m_tree.isAnimationEnabled()) {
            // could be null if already detached
            // animate
            (new Animation() {

                /**
                 * @see com.google.gwt.animation.client.Animation#onComplete()
                 */
                @Override
                protected void onComplete() {

                    super.onComplete();
                    m_children.removeItem(item);
                    onChangeChildren();
                }

                /**
                 * @see com.google.gwt.animation.client.Animation#onUpdate(double)
                 */
                @Override
                protected void onUpdate(double progress) {

                    item.getElement().getStyle().setOpacity(1 - progress);
                }
            }).run(ANIMATION_DURATION);
        } else {
            m_children.removeItem(item);
            onChangeChildren();
        }
        return item;
    }
1228667
protected void sort(List<CmsTreeItem> items, SortParams sort) {

        int sortParam = -1;
        boolean ascending = true;
        switch (sort) {
            case tree:
                m_quickSearch.setFormValueAsString("");
                m_listView = false;
                updateContentTree();
                break;
            case title_asc:
                sortParam = 0;
                break;
            case title_desc:
                sortParam = 0;
                ascending = false;
                break;
            case path_asc:
                sortParam = 1;
                break;
            case path_desc:
                sortParam = 1;
                ascending = false;
                break;
            default:
                break;
        }
        if (sortParam != -1) {
            m_listView = true;
            items = getFilteredCategories(hasQuickFilter() ? m_quickSearch.getFormValueAsString() : null);
            Collections.sort(items, new CmsListItemDataComparator(sortParam, ascending));
            updateContentList(items);
        }
    }
124340
protected void adopt(final CmsTreeItem item) {

        item.setParentItem(this);
        item.setTree(m_tree);
        onChangeChildren();
        if ((m_tree != null) && m_tree.isAnimationEnabled()) {
            // could be null if not yet attached
            item.getElement().getStyle().setOpacity(0);
            // animate
            (new Animation() {

                /**
                 * @see com.google.gwt.animation.client.Animation#onUpdate(double)
                 */
                @Override
                protected void onUpdate(double progress) {

                    item.getElement().getStyle().setOpacity(progress);
                }
            }).run(ANIMATION_DURATION);
        }
    }
1312328
@Override
    @SuppressWarnings("deprecation")
    public boolean canRemoveItem( String itemName ) {
        CheckArg.isNotNull(itemName, "itemName");
        Name childName = context.getValueFactories().getNameFactory().create(itemName);
        return nodeTypes().canRemoveItem(this.name, null, childName, true);
    }