VTree tree = (VTree) VDragAndDropManager.get().getCurrentDropHandler()
.getConnector().getWidget();
TreeNode treeNode = tree.getNodeByKey((String) drag.getDropDetails()
.get("itemIdOver"));
if (treeNode != null) {
Widget parent2 = treeNode;
int depth = configuration.getIntAttribute("depth");
if (depth < 0) {
depth = Integer.MAX_VALUE;
}
final String searchedKey = configuration.getStringAttribute("key");
for (int i = 0; i <= depth && parent2 instanceof TreeNode; i++) {
if (searchedKey.equals(((TreeNode) parent2).key)) {
return true;
}
// panel -> next level node
parent2 = parent2.getParent().getParent();
}
}
return false;
}