Search in sources :

Example 1 with VerticalGridMatrix

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());
}
Also used : IFormField(org.eclipse.scout.rt.client.ui.form.fields.IFormField) VerticalGridMatrix(org.eclipse.scout.rt.client.ui.form.fields.groupbox.internal.matrix.VerticalGridMatrix) GridData(org.eclipse.scout.rt.client.ui.form.fields.GridData)

Aggregations

GridData (org.eclipse.scout.rt.client.ui.form.fields.GridData)1 IFormField (org.eclipse.scout.rt.client.ui.form.fields.IFormField)1 VerticalGridMatrix (org.eclipse.scout.rt.client.ui.form.fields.groupbox.internal.matrix.VerticalGridMatrix)1