event.setCancelled(false);
}
@Override
protected void showFeedback(DNDEvent event) {
final TreeNode overItem = tree.findNode(event.getTarget());
if (overItem == null) {
clearStyles(event);
}
if (overItem != null && event.getDropTarget().component == event.getDragSource().component) {
TreePanel source = (TreePanel) event.getDragSource().component;
List<ModelData> list = source.getSelectionModel().getSelection();
ModelData overModel = overItem.getModel();
for (int i = 0; i < list.size(); i++) {
ModelData sel = list.get(i);
if (overModel == sel) {
clearStyles(event);
return;
}
List<ModelData> children = tree.getStore().getChildren(sel, true);
if (children.contains(overItem.getModel())) {
clearStyles(event);
return;
}
}
}
boolean append = feedback == Feedback.APPEND || feedback == Feedback.BOTH;
boolean insert = feedback == Feedback.INSERT || feedback == Feedback.BOTH;
if (overItem == null) {
handleAppend(event, overItem);
} else if (insert) {
handleInsert(event, overItem);
} else if ((!overItem.isLeaf() || allowDropOnLeaf) && append) {
handleAppend(event, overItem);
} else {
if (activeItem != null) {
tree.getView().onDropChange(activeItem, false);
}