}
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(CSS_DRAGDROP_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 (Iterator iterator = context.selectedWidgets.iterator(); iterator.hasNext();) {
Widget widget = (Widget) iterator.next();
width += widget.getOffsetWidth();
height = Math.max(height, widget.getOffsetHeight());
}
} else {
for (Iterator iterator = context.selectedWidgets.iterator(); iterator.hasNext();) {
Widget widget = (Widget) iterator.next();
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;