code: private CmsTreeItem buildTreeItem(
          CmsCategoryTreeEntry category,
          Collection<String> selectedCategories,
          boolean inactive) {
  
          CmsDataValue categoryTreeItem = new CmsDataValue(
              500,
              4,
              CmsCategoryBean.SMALL_ICON_CLASSES,
              category.getTitle(),
              category.getPath());
          if (inactive) {
              categoryTreeItem.setInactive();
          }
          categoryTreeItem.setTitle(
              CmsStringUtil.isNotEmptyOrWhitespaceOnly(category.getDescription())
              ? category.getDescription()
              : category.getPath());
          CmsTreeItem treeItem = new CmsTreeItem(false, categoryTreeItem);
          treeItem.setId(category.getPath());
          boolean isPartofPath = false;
          Iterator<String> it = selectedCategories.iterator();
          while (it.hasNext()) {
              String path = it.next();
              if (path.startsWith(category.getPath()) || path.contains("/" + category.getPath())) {
                  isPartofPath = true;
              }
          }
          if (isPartofPath) {
              m_categories.add(treeItem);
              treeItem.setOpen(true);
          }
          return treeItem;
      }
docs: Builds a tree item for the given category.<p>
  
  @param category the category
  @param selectedCategories the selected categories
  @param inactive true if the value should be displayed inactive
  
  @return the tree item widget