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 (event.getDropTarget().component == event.getDragSource().component) {
TreeGrid source = (TreeGrid) event.getDragSource().component;
ModelData sel = source.getSelectionModel().getSelectedItem();
ModelData overModel = item.getModel();
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);
}