Group insertGroup = crosstab;
final GroupDefinition[] groupDefinitions = wizardSpecification.getGroupDefinitions();
for (int i = 0; i < groupDefinitions.length; i++)
{
final GroupDefinition groupDefinition = groupDefinitions[i];
if (GroupType.CT_OTHER.equals(groupDefinition.getGroupType()) == false)
{
continue;
}
// create a new group and insert it at the end
final CrosstabOtherGroup relationalGroup = new CrosstabOtherGroup();
if (groupDefinition.getGroupName() != null)
{
relationalGroup.setName(groupDefinition.getGroupName());
}
configureCrosstabOtherGroup(relationalGroup, groupDefinition);
insertGroup.setBody(new CrosstabOtherGroupBody(relationalGroup));
insertGroup = relationalGroup;
}
for (int i = 0; i < groupDefinitions.length; i++)
{
final GroupDefinition groupDefinition = groupDefinitions[i];
if (GroupType.CT_ROW.equals(groupDefinition.getGroupType()) == false)
{
continue;
}
// create a new group and insert it at the end
final CrosstabRowGroup relationalGroup = new CrosstabRowGroup();
if (groupDefinition.getGroupName() != null)
{
relationalGroup.setName(groupDefinition.getGroupName());
}
configureCrosstabRowGroup(relationalGroup, groupDefinition);
insertGroup.setBody(new CrosstabRowGroupBody(relationalGroup));
insertGroup = relationalGroup;
}
for (int i = 0; i < groupDefinitions.length; i++)
{
final GroupDefinition groupDefinition = groupDefinitions[i];
if (GroupType.CT_COLUMN.equals(groupDefinition.getGroupType()) == false)
{
continue;
}
// create a new group and insert it at the end
final CrosstabColumnGroup relationalGroup = new CrosstabColumnGroup();
if (groupDefinition.getGroupName() != null)
{
relationalGroup.setName(groupDefinition.getGroupName());
}
configureCrosstabColumnGroup(relationalGroup, groupDefinition);
insertGroup.setBody(new CrosstabColumnGroupBody(relationalGroup));
insertGroup = relationalGroup;
}