private CmsTreeItem buildTreeItem(CmsCategoryTreeEntry category, List<String> selectedCategories) {

        m_categories.put(category.getPath(), category);
        // set the list item widget
        CmsDataValue dataValue = new CmsDataValue(
            600,
            3,
            CmsCategoryBean.SMALL_ICON_CLASSES,
            category.getTitle(),
            CmsStringUtil.isNotEmptyOrWhitespaceOnly(category.getDescription())
            ? category.getDescription()
            : category.getPath());

        // the checkbox
        CmsCheckBox checkBox = new CmsCheckBox();
        if ((selectedCategories != null) && selectedCategories.contains(category.getPath())) {
            checkBox.setChecked(true);
        }
        SelectionHandler selectionHandler = new SelectionHandler(category.getPath(), checkBox);
        checkBox.addClickHandler(selectionHandler);
        dataValue.addClickHandler(selectionHandler);
        dataValue.addButton(createSelectButton(selectionHandler));
        dataValue.setUnselectable();
        // set the category tree item and add to list
        CmsTreeItem treeItem = new CmsTreeItem(true, checkBox, dataValue);
        treeItem.setSmallView(true);
        treeItem.setId(category.getPath());
        return treeItem;
    }
private CmsTreeItem buildTreeItem ( CmsCategoryTreeEntry category , List < String > selectedCategories ) { m_categories . put ( category . getPath ( ) , category ) ; CmsDataValue dataValue = new CmsDataValue ( 600 , 3 , CmsCategoryBean . SMALL_ICON_CLASSES , category . getTitle ( ) , CmsStringUtil . isNotEmptyOrWhitespaceOnly ( category . getDescription ( ) ) ? category . getDescription ( ) : category . getPath ( ) ) ; CmsCheckBox checkBox = new CmsCheckBox ( ) ; if ( ( selectedCategories != null ) && selectedCategories . contains ( category . getPath ( ) ) ) { checkBox . setChecked ( true ) ; } SelectionHandler selectionHandler = new SelectionHandler ( category . getPath ( ) , checkBox ) ; checkBox . addClickHandler ( selectionHandler ) ; dataValue . addClickHandler ( selectionHandler ) ; dataValue . addButton ( createSelectButton ( selectionHandler ) ) ; dataValue . setUnselectable ( ) ; CmsTreeItem treeItem = new CmsTreeItem ( true , checkBox , dataValue ) ; treeItem . setSmallView ( true ) ; treeItem . setId ( category . getPath ( ) ) ; return treeItem ; }
Builds a tree item for the given category.<p>

@param category the category
@param selectedCategories the selected categories

@return the tree item widget