@Override
protected Widget newPositioner(DragContext context) {
// Use two widgets so that setPixelSize() consistently affects dimensions
// excluding positioner border in quirks and strict modes
SimplePanel outer = new SimplePanel();
outer.addStyleName(DragClientBundle.INSTANCE.css().positioner());
// place off screen for border calculation
RootPanel.get().add(outer, -500, -500);
// Ensure IE quirks mode returns valid outer.offsetHeight, and thus valid
// DOMUtil.getVerticalBorders(outer)
outer.setWidget(DUMMY_LABEL_IE_QUIRKS_MODE_OFFSET_HEIGHT);
int width = 0;
int height = 0;
if (dropTarget instanceof HorizontalPanel) {
for (Widget widget : context.selectedWidgets) {
width += widget.getOffsetWidth();
height = Math.max(height, widget.getOffsetHeight());
}
} else {
for (Widget widget : context.selectedWidgets) {
width = Math.max(width, widget.getOffsetWidth());
height += widget.getOffsetHeight();
}
}
SimplePanel inner = new SimplePanel();
inner.setPixelSize(width - DOMUtil.getHorizontalBorders(outer), height
- DOMUtil.getVerticalBorders(outer));
outer.setWidget(inner);
return outer;