use of com.extjs.gxt.ui.client.widget.layout.HBoxLayout in project activityinfo by bedatadriven.
the class LocationForm method addNewLocationButtons.
private void addNewLocationButtons() {
int buttonWidth = (FIELD_WIDTH - BUTTON_SPACE) / 2;
Button saveButton = new Button(I18N.CONSTANTS.useNewLocation(), IconImageBundle.ICONS.save(), new SelectionListener<ButtonEvent>() {
@Override
public void componentSelected(ButtonEvent ce) {
saveNewLocation();
}
});
saveButton.setWidth(buttonWidth);
Button cancelButton = new Button(I18N.CONSTANTS.cancel(), new SelectionListener<ButtonEvent>() {
@Override
public void componentSelected(ButtonEvent ce) {
newLocationPresenter.setActive(false, true);
}
});
cancelButton.setWidth(buttonWidth);
newFormButtonContainer = new LayoutContainer();
newFormButtonContainer.setWidth(FIELD_WIDTH);
newFormButtonContainer.setLayout(new HBoxLayout());
newFormButtonContainer.add(saveButton);
newFormButtonContainer.add(cancelButton, new HBoxLayoutData(0, 0, 0, BUTTON_SPACE));
add(newFormButtonContainer, buttonLayout());
setNewFormActive(false);
}
use of com.extjs.gxt.ui.client.widget.layout.HBoxLayout in project activityinfo by bedatadriven.
the class IndicatorSection method addMixedGroup.
private void addMixedGroup(IndicatorGroup group) {
for (IndicatorDTO indicator : group.getIndicators()) {
if (!indicator.isCalculated() && indicator.isVisible()) {
Text fieldLabel = createLabel(indicator);
fieldLabel.setStyleAttribute("marginTop", "8px");
fieldLabel.setStyleAttribute("marginBottom", "3px");
add(fieldLabel);
TextField field = createField(indicator);
if (indicator.getType() == FieldTypeClass.QUANTITY) {
HBoxLayout rowLayout = new HBoxLayout();
rowLayout.setHBoxLayoutAlign(HBoxLayout.HBoxLayoutAlign.MIDDLE);
Text unitsLabel = new Text(indicator.getUnits());
unitsLabel.setStyleAttribute("paddingLeft", "5px");
LayoutContainer row = new LayoutContainer();
row.setLayout(rowLayout);
row.add(field);
row.add(unitsLabel);
add(row);
} else {
field.setWidth(TEXT_FIELD_WIDTH);
add(field);
}
}
}
}
Aggregations