public void removeFromSelection(Set<Entity> selection) {

    if (tree == null) return;
    Array<Node> allSceneRootNodes = tree.getNodes().get(0).getChildren();

    for (int entityId : EntityUtils.getEntityId(selection)) {
      for (Node n : allSceneRootNodes) {
        if (n.getObject().equals(entityId)) {
          tree.getSelection().remove(n);
          break;
        }
      }
    }
  }
  public void setSelection(Set<Entity> selection) {

    if (tree == null) return;
    tree.getSelection().clear();
    if (selection == null) return;
    addToSelection(selection);
  }
 public void init(Entity rootScene) {
   treeTable.clear();
   tree = new VisTree();
   VisScrollPane scroller = new VisScrollPane(tree);
   scroller.setFlickScroll(false);
   treeTable.add(scroller).width(166).maxHeight(570);
   //
   Node root = addTreeRoot(rootScene, null);
   root.setExpanded(true);
   tree.addListener(new TreeChangeListener());
 }
 private Node addTreeNode(Entity item, Node parentNode) {
   Node node = new Node(new VisLabel(parentNode == null ? "root" : getItemName(item)));
   MainItemComponent mainItemComponent = ComponentRetriever.get(item, MainItemComponent.class);
   node.setObject(mainItemComponent.uniqueId);
   if (parentNode != null) {
     parentNode.add(node);
   } else {
     tree.add(node);
   }
   return node;
 }