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