WrapperTargetDetails ed = (WrapperTargetDetails) event
.getTargetDetails();
Transferable ctr = event.getTransferable();
// use "component" (from DragDropPane) if available, else take
// the source component
Component component = null;
if (ctr instanceof WrapperTransferable) {
component = ((WrapperTransferable) ctr).getDraggedComponent();
} else if (ctr instanceof DataBoundTransferable) {
// Item has been dragged, construct a Label from
// Item id
Label l = new Label();
l.setSizeUndefined();
l.setValue("ItemId : " + ((DataBoundTransferable) ctr).getItemId());
component = l;
}
if (component != null) {
if (component.getParent() != root) {
root.addComponent(component);
Integer left = ed.getAbsoluteLeft();
Integer top = ed.getAbsoluteTop();