Search in sources :

Example 1 with HBoxLayout

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);
}
Also used : Button(com.extjs.gxt.ui.client.widget.button.Button) LayoutContainer(com.extjs.gxt.ui.client.widget.LayoutContainer) HBoxLayout(com.extjs.gxt.ui.client.widget.layout.HBoxLayout) HBoxLayoutData(com.extjs.gxt.ui.client.widget.layout.HBoxLayoutData)

Example 2 with HBoxLayout

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);
            }
        }
    }
}
Also used : IndicatorDTO(org.activityinfo.legacy.shared.model.IndicatorDTO) LayoutContainer(com.extjs.gxt.ui.client.widget.LayoutContainer) HBoxLayout(com.extjs.gxt.ui.client.widget.layout.HBoxLayout) TextField(com.extjs.gxt.ui.client.widget.form.TextField) Text(com.extjs.gxt.ui.client.widget.Text)

Aggregations

LayoutContainer (com.extjs.gxt.ui.client.widget.LayoutContainer)2 HBoxLayout (com.extjs.gxt.ui.client.widget.layout.HBoxLayout)2 Text (com.extjs.gxt.ui.client.widget.Text)1 Button (com.extjs.gxt.ui.client.widget.button.Button)1 TextField (com.extjs.gxt.ui.client.widget.form.TextField)1 HBoxLayoutData (com.extjs.gxt.ui.client.widget.layout.HBoxLayoutData)1 IndicatorDTO (org.activityinfo.legacy.shared.model.IndicatorDTO)1