return false;
}
if (rawLeadSelection instanceof Band)
{
final Band target = (Band) rawLeadSelection;
if (target == insert)
{
return false;
}
if (ModelUtility.isDescendant(target, insert))
{
return false;
}
if (insert.getParent() != null)
{
// this should not happen. We should only see clones here ..
throw new IllegalStateException();
}
try
{
final Element element = normalizeForInsert(insert);
if (element == null)
{
return false;
}
if (element instanceof SubReport)
{
final Object subreportHint = insert.getAttribute(ReportDesignerBoot.DESIGNER_NAMESPACE, SUBREPORT_BANDED_HINT);
if (Boolean.TRUE.equals(subreportHint))
{
if (target instanceof AbstractRootLevelBand)
{
final AbstractRootLevelBand rlb = (AbstractRootLevelBand) target;
rlb.addSubReport((SubReport) element);
return element;
}
else
{
return false;
}
}
}
target.addElement(element);
return element;
}
catch (CloneNotSupportedException e1)
{
UncaughtExceptionsModel.getInstance().addException(e1);