我可以通过以下方式从DragAndDropEvent获取源组件形式:
final DataBoundTransferable t = (DataBoundTransferable) event.getTransferable();
Component from = t.getSourceComponent();
如何从DragAndDropEvent获取目标组件? (释放鼠标的组件。)可惜没有t.getTargetComponent()...
看Drag & Drop secion of the book of vaadin
event.getTargetDetails()应该是您搜索的内容
public void drop(DragAndDropEvent event) {
// Wrapper for the object that is dragged
Transferable t = event.getTransferable();
// Make sure the drag source is the same tree
if (t.getSourceComponent() != tree)
return;
TreeTargetDetails target = (TreeTargetDetails)
event.getTargetDetails();
....