protected UndoEntry moveDataFactories(final AbstractReportDefinition report, final Object element)
throws ReportDataFactoryException
{
final CompoundDataFactory collection = (CompoundDataFactory) report.getDataFactory();
final int dataFactoryCount = collection.size();
for (int j = 0; j < dataFactoryCount; j++)
{
final DataFactory dataFactory = collection.getReference(j);
if (element == dataFactory)
{
if (collection.size() > j + 1)
{
collection.remove(j);
collection.add(j + 1, dataFactory);
report.fireModelLayoutChanged(report, ReportModelEvent.NODE_STRUCTURE_CHANGED, dataFactory);
return new CompoundUndoEntry
(new DataSourceEditUndoEntry(j, dataFactory, null), new DataSourceEditUndoEntry(j + 1, null, dataFactory));
}