final ReportElementEditorContext dragContext,
final ElementMetaData elementMetaData,
final String fieldName)
{
final Container representationContainer = dragContext.getRepresentationContainer();
final ReportRenderContext renderContext = dragContext.getRenderContext();
final Point pos = event.getLocation();
final Point2D point = dragContext.normalize(pos);
if (point.getX() < 0 || point.getY() < 0)
{
representationContainer.removeAll();
return DnDConstants.ACTION_NONE;
}
final Element rootBand = findRootBand(dragContext, point);
if (rootBand instanceof PageHeader ||
rootBand instanceof PageFooter ||
rootBand instanceof DetailsHeader ||
rootBand instanceof DetailsFooter ||
rootBand instanceof Watermark)
{
representationContainer.removeAll();
return DnDConstants.ACTION_NONE;
}
representation.setZoom(renderContext.getZoomModel().getZoomAsPercentage());
representation.setVisible(true);
representation.setText(elementMetaData.getDisplayName(Locale.getDefault()));
representation.setLocation(pos.x, pos.y);
representation.setSize(representation.getMinimumSize());
representationContainer.removeAll();