The column is a VerticalPanel which contains many Widgets.
@Override
public void onDrop(DragContext context) {
super.onDrop(context);
final Widget widget = context.draggable;
final int newIndex = columnPanel.getWidgetIndex(widget);
}
@Override
|
public void onPreviewDrop(DragContext context) throws VetoDragException {
|
super.onPreviewDrop(context);
|
int newIndex = ??? |
} |
in onDrop() I can get the new position of a widget in the columnPanel with columnPanel.getWidgetIndex(widget) but in onPreviewDrop() I cannot do it because the widget is not inside the columnPanel at this time.
How do I get the target index where a dropped Widget should be dropped into the columnPanel in onPreviewDrop()? I want to know where the widget should be inserted before it is inserted. This way I can cancel the insertion.