use of com.extjs.gxt.ui.client.widget.layout.TableData in project activityinfo by bedatadriven.
the class IndicatorSection method addQuantityTable.
private void addQuantityTable(IndicatorGroup group) {
// Layout in three columns
// Label | Field | Units
TableData fieldLayout = new TableData();
fieldLayout.setWidth(NUMBER_FIELD_WIDTH + "px");
fieldLayout.setVerticalAlign(Style.VerticalAlignment.TOP);
TableData unitLayout = new TableData();
unitLayout.setWidth(UNITS_FIELD_WIDTH + "px");
unitLayout.setVerticalAlign(Style.VerticalAlignment.TOP);
TableLayout layout = new TableLayout();
layout.setWidth("100%");
layout.setColumns(3);
layout.setCellPadding(5);
LayoutContainer table = new LayoutContainer();
table.setLayout(layout);
table.setAutoHeight(true);
for (IndicatorDTO indicator : group.getIndicators()) {
if (!indicator.isCalculated() && indicator.isVisible()) {
Text fieldLabel = createLabel(indicator);
Field field = createField(indicator);
field.setWidth(NUMBER_FIELD_WIDTH);
Text unitLabel = new Text(indicator.getUnits());
unitLabel.setWidth(UNITS_FIELD_WIDTH);
unitLabel.setStyleAttribute("fontSize", "9pt");
table.add(fieldLabel);
table.add(field, fieldLayout);
table.add(unitLabel, unitLayout);
}
}
add(table);
}
Aggregations