use of org.eclipse.scout.rt.client.ui.form.fields.groupbox.internal.matrix.VerticalGridMatrix in project scout.rt by eclipse.
the class VerticalSmartGroupBoxBodyGrid method layoutAllDynamic.
@Override
protected void layoutAllDynamic(List<IFormField> fields) {
// calculate the used cells
int cellCount = 0;
for (IFormField f : fields) {
GridData hints = getGridDataFromHints(f, getGridColumnCount());
cellCount += hints.w * hints.h;
}
int rowCount = (cellCount + getGridColumnCount() - 1) / getGridColumnCount();
VerticalGridMatrix matrix = new VerticalGridMatrix(getGridColumnCount(), rowCount);
while (!matrix.computeGridData(fields)) {
matrix.resetAll(getGridColumnCount(), ++rowCount);
}
// setGridData
for (IFormField f : fields) {
GridData data = matrix.getGridData(f);
f.setGridDataInternal(data);
}
setGridRows(matrix.getRowCount());
}
Aggregations