private float getHeightInItem(DropTargetEvent event) {
if(event.item == null) return .5f;
if (event.item instanceof TreeItem) {
TreeItem treeItem = (TreeItem) event.item;
Control control = treeItem.getParent();
Point point = control.toControl(new Point(event.x, event.y));
Rectangle bounds = treeItem.getBounds();
return (float) (point.y - bounds.y) / (float) bounds.height;
}
else if (event.item instanceof TableItem) {
TableItem tableItem = (TableItem) event.item;