table.setWidget(row, col, group);
cf.setStyleName(row, col, cellClass);
HorizontalAlignmentConstant align = config.getHorizontalAlignment();
cf.setHorizontalAlignment(row, col, align);
int ncs = cs;
if (cs > 1) {
for (int i = col; i < (col + cs); i++) {
if (cm.isHidden(i)) {
ncs -= 1;
}
}
}
cf.setRowSpan(row, col, rs);
cf.setColSpan(row, col, ncs);
}
for (int i = 0; i < cols; i++) {
Head h = createNewHead(cm.getColumn(i));
if (cm.isHidden(i)) {
continue;
}
int rowspan = 1;
if (rows > 1) {
for (int j = rows - 2; j >= 0; j--) {
if (!cm.hasGroup(j, i)) {
rowspan += 1;
}
}
}
int row;
if (rowspan > 1) {
row = (rows - 1) - (rowspan - 1);
} else {
row = rows - 1;
}
h.row = row;
if (rowspan > 1) {
table.setWidget(row, i, h);
table.getFlexCellFormatter().setRowSpan(row, i, rowspan);
} else {
table.setWidget(row, i, h);
}
ColumnConfig<M, ?> cc = cm.getColumn(i);
String s = cc.getColumnClassSuffix() == null ? "" : " x-grid-td-" + cc.getColumnClassSuffix();
cf.setStyleName(row, i, cellClass + s);
cf.getElement(row, i).setPropertyInt("gridColumnIndex", i);
HorizontalAlignmentConstant align = cm.getColumnAlignment(i);
if (align != null) {
table.getCellFormatter().setHorizontalAlignment(row, i, align);
if (align == HasHorizontalAlignment.ALIGN_RIGHT) {
table.getCellFormatter().getElement(row, i).getFirstChildElement().getStyle().setPropertyPx("paddingRight",
16);