code: private CmsTreeItem buildTreeItem(CmsCategoryTreeEntry category, Collection<String> selectedCategories) {
  
          // generate the widget that should be shown in the list
          CmsDataValue dataValue = new CmsDataValue(
              600,
              3,
              CmsCategoryBean.SMALL_ICON_CLASSES,
              true,
              category.getTitle(),
              "rtl:" + category.getPath(),
              "hide:" + category.getSitePath());
  
          // create the check box for this item
          CmsCheckBox checkBox = new CmsCheckBox();
          // if it has to be selected, select it
          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) {
              checkBox.setChecked(true);
          }
          if (!isEnabled()) {
              checkBox.disable(m_disabledReason);
          }
          if (category.getPath().isEmpty()) {
              checkBox.setVisible(false);
          }
          // bild the CmsTreeItem out of the widget and the check box
          CmsTreeItem treeItem = new CmsTreeItem(true, checkBox, dataValue);
          // abb the handler to the check box
          dataValue.addClickHandler(new DataValueClickHander(treeItem));
  
          checkBox.addValueChangeHandler(new CheckBoxValueChangeHandler(treeItem));
  
          // set the right style for the small view
          treeItem.setSmallView(true);
          treeItem.setId(category.getPath());
          // add it to the list of all categories
          m_categories.put(treeItem.getId(), treeItem);
          return treeItem;
      }
docs: Builds a tree item for the given category.<p>
  
  @param category the category
  @param selectedCategories the selected categories
  
  @return the tree item widget