added method for adding components recursively to treeItems