}
El side = leftTr;
int pos = 0;
for (int i = 0, len = container.getItemCount(); i < len; i++, pos++) {
Component c = container.getItem(i);
if (c instanceof FillToolItem) {
side = rightTr;
pos = -1;
} else if (!c.isRendered()) {
c.render(insertCell(c, side, pos));
if (i < len - 1) {
c.el().setStyleAttribute("marginRight", spacing + "px");
} else {
c.el().setStyleAttribute("marginRight", "0px");
}
} else {
if (!isHidden(c) && !isValidParent(c.el().dom, side.getChildElement(pos))) {
Element td = insertCell(c, side, pos);
td.appendChild(c.el().dom);
if (i < len - 1) {
c.el().setStyleAttribute("marginRight", spacing + "px");
} else {
c.el().setStyleAttribute("marginRight", "0px");
}
}
}
}
// strip extra empty cells