use of org.eclipse.scout.rt.client.ui.form.fields.GridData in project scout.rt by eclipse.
the class AbstractGroupBoxBodyGrid method getGridDataFromHints.
/**
* if grid w greater than group box column count. Grid w will be set to group box column count.
*/
public static GridData getGridDataFromHints(IFormField field, int groupBoxColumnCount) {
GridData data = GridDataBuilder.createFromHints(field, groupBoxColumnCount);
data.w = Math.min(groupBoxColumnCount, data.w);
return data;
}
use of org.eclipse.scout.rt.client.ui.form.fields.GridData in project scout.rt by eclipse.
the class GroupBoxProcessButtonGrid method validate.
public void validate() {
// reset
List<IButton> buttonList = new ArrayList<IButton>();
if (m_includeCustomButtons) {
buttonList.addAll(m_groupBox.getCustomProcessButtons());
}
if (m_includeSystemButtons) {
buttonList.addAll(m_groupBox.getSystemProcessButtons());
}
// filter
for (Iterator it = buttonList.iterator(); it.hasNext(); ) {
IButton b = (IButton) it.next();
if (!b.isVisible()) {
GridData data = GridDataBuilder.createFromHints(b, 1);
b.setGridDataInternal(data);
it.remove();
}
}
m_buttons = buttonList;
layoutStatic();
}
use of org.eclipse.scout.rt.client.ui.form.fields.GridData 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());
}
use of org.eclipse.scout.rt.client.ui.form.fields.GridData in project scout.rt by eclipse.
the class HorizontalGridMatrix method computeGridData.
@Override
public boolean computeGridData(List<IFormField> fields) {
for (IFormField f : fields) {
GridData hints = GridDataBuilder.createFromHints(f, m_columnCount);
GridData gridData = new GridData(hints);
gridData.w = Math.min(hints.w, m_columnCount);
add(f, hints, gridData);
f.setGridDataInternal(gridData);
}
return true;
}
use of org.eclipse.scout.rt.client.ui.form.fields.GridData in project scout.rt by eclipse.
the class VerticalGridMatrix method computeGridData.
@Override
public boolean computeGridData(List<IFormField> fields) {
int i = 0;
for (IFormField field : fields) {
m_formFieldIndexes.put(field, i++);
GridData gridData = AbstractGroupBoxBodyGrid.getGridDataFromHints(field, m_cursor.columnCount);
if (add(field, gridData)) {
m_fieldGridDatas.put(field, gridData);
} else {
return false;
}
}
return true;
}
Aggregations