ITextOuterTable outerTable,
Document document,
String mode,
WorkflowState workflowState,
ConstraintClient constraintClient) throws DocumentException {
ITextOuterTableCell outputCell;
ITextOuterTableCell dummyCell = null;
FormBuilderItemConstraint activeConstraint = null;
int halfwidthcount = 0;
for (int i = 0; i < items.size(); ++i) {
FormBuilderItemBase item = items.get(i).getFormBuilderItem();
FormBuilderItemData itemData = items.get(i).getFormBuilderItemData();
if(itemData != null) {
ConstraintVariablesContainer constraintVariablesContainer = new ConstraintVariablesContainer();
activeConstraint = FormFillerInternalRenderer.checkConstraints(
itemData,
activeConstraint,
constraintVariablesContainer,
workflowState,
constraintClient);
}
if (!item.getSkipRendering() &&
item.getProperties().getVisible()) {
switch (item.getWidth()) {
case FormBuilderItemBase.FULLWIDTH:
outputCell = new ITextOuterTableCell(2);
halfwidthcount = 0;
break;
case FormBuilderItemBase.HALFWIDTH:
outputCell = new ITextOuterTableCell(1);
halfwidthcount++;
if (((i + 1 < items.size()
&& items.get(i + 1).getFormBuilderItem().getWidth().equals(FormBuilderItemBase.FULLWIDTH)) || (i + 1 == items.size()
&& items.get(i).getFormBuilderItem().getWidth().equals(FormBuilderItemBase.HALFWIDTH)))
&& halfwidthcount % 2 == 1) {
dummyCell = new ITextOuterTableCell(1);
dummyCell.addElement(new ITextParagraph(""));
}
break;
default:
outputCell = new ITextOuterTableCell(2);
}
if(itemData != null) {
outputCell.addElement(FormBuilderItemPdfFactory.getUIPdfComponent(itemData, mode));
} else {
outputCell.addElement(FormBuilderItemPdfFactory.getUIPdfComponent(item));