return;
}
try
{
final ElementType type = metaData.create();
final Element visualElement = (Element) type.create();
if (visualElement instanceof SubReport)
{
final Element rootBand = findRootBand(band);
if (rootBand == null ||
rootBand instanceof PageHeader ||
rootBand instanceof PageFooter ||
rootBand instanceof DetailsHeader ||
rootBand instanceof DetailsFooter ||
rootBand instanceof Watermark)
{
return;
}
}
final ElementStyleSheet styleSheet = visualElement.getStyle();
styleSheet.setStyleProperty(ElementStyleKeys.MIN_WIDTH, DEFAULT_WIDTH);
styleSheet.setStyleProperty(ElementStyleKeys.MIN_HEIGHT, DEFAULT_HEIGHT);
type.configureDesignTimeDefaults(visualElement, Locale.getDefault());
final ReportDocumentContext context = getActiveContext();
final UndoManager undo = context.getUndo();
undo.addChange(ActionMessages.getString("InsertElementAction.UndoName"),