@Override
public void drop(DragAndDropEvent dropEvent) {
// criteria verify that this is safe
DataBoundTransferable t = (DataBoundTransferable) dropEvent
.getTransferable();
Container sourceContainer = t.getSourceContainer();
Object sourceItemId = t.getItemId();
System.out.println(sourceItemId);
AbstractSelectTargetDetails dropData = ((AbstractSelectTargetDetails) dropEvent
.getTargetDetails());
Object targetItemId = dropData.getItemIdOver();
// move item from table to category'
tree.addItem(sourceItemId);
tree.setParent(sourceItemId, targetItemId);
tree.setChildrenAllowed(sourceItemId, false);
sourceContainer.removeItem(sourceItemId);
}
});
tree.addItem("Item 1");