int cxmin = dropTargetParent.getElement().getAbsoluteLeft();
int cymin = dropTargetParent.getElement().getAbsoluteTop();
int cxmax = dropTargetParent.getElement().getAbsoluteRight();
int cymax = dropTargetParent.getElement().getAbsoluteBottom();
final CoordinateArea ca = new CoordinateArea( cxmin,
cymin,
cxmax,
cymax );
//Display Compass if not already visible
if ( !isAttached() ) {
setPopupPositionAndShow( new PositionCallback() {
@Override
public void setPosition( int offsetWidth,
int offsetHeight ) {
setPopupPosition( ca.getCenter().getLeft() - ( offsetWidth / 2 ),
ca.getCenter().getTop() - ( offsetHeight / 2 ) );
}
} );
} else {
setPopupPosition( ca.getCenter().getLeft() - ( getOffsetWidth() / 2 ),
ca.getCenter().getTop() - ( getOffsetHeight() / 2 ) );
}
}