Search in sources :

Example 1 with LayoutContainer

use of com.extjs.gxt.ui.client.widget.LayoutContainer 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 LayoutContainer

use of com.extjs.gxt.ui.client.widget.LayoutContainer in project activityinfo by bedatadriven.

the class PivotTableEditor method createGridContainer.

private void createGridContainer() {
    center = new LayoutContainer();
    center.setLayout(new BorderLayout());
    add(center, new BorderLayoutData(Style.LayoutRegion.CENTER));
    gridPanel = new PivotGridPanel(service);
    gridPanel.setHeaderVisible(true);
    gridPanel.setHeadingText(I18N.CONSTANTS.preview());
    center.add(gridPanel, new BorderLayoutData(Style.LayoutRegion.CENTER));
    viewBinder = new PivotTableBinder(eventBus, service, gridPanel);
}
Also used : BorderLayout(com.extjs.gxt.ui.client.widget.layout.BorderLayout) PivotGridPanel(org.activityinfo.ui.client.component.report.view.PivotGridPanel) LayoutContainer(com.extjs.gxt.ui.client.widget.LayoutContainer) BorderLayoutData(com.extjs.gxt.ui.client.widget.layout.BorderLayoutData)

Example 3 with LayoutContainer

use of com.extjs.gxt.ui.client.widget.LayoutContainer 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)

Example 4 with LayoutContainer

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

Example 5 with LayoutContainer

use of com.extjs.gxt.ui.client.widget.LayoutContainer in project activityinfo by bedatadriven.

the class LocationDialog method addSearchPanel.

private void addSearchPanel(LocationTypeDTO locationType) {
    LayoutContainer container = new LayoutContainer();
    container.setLayout(new FlowLayout());
    container.setScrollMode(Scroll.AUTOY);
    container.addStyleName(SiteFormResources.INSTANCE.style().locationDialogPane());
    container.add(newHeader(I18N.CONSTANTS.chooseLocation()));
    container.add(newExplanation(I18N.CONSTANTS.chooseLocationDescription()));
    container.add(formHeader = newHeader(I18N.CONSTANTS.searchLocations()));
    container.add(new LocationForm(dispatcher, locationType, searchPresenter, newLocationPresenter));
    container.add(newHeader(I18N.CONSTANTS.searchResults()));
    container.add(new SearchListView(searchPresenter));
    container.add(new SearchStatusView(searchPresenter));
    addLocationHeader = newHeader(I18N.CONSTANTS.addLocation());
    addLocationHelp = newExplanation(I18N.CONSTANTS.addLocationDescription());
    addLocationButton = new Button(I18N.CONSTANTS.newLocation(), IconImageBundle.ICONS.add(), new SelectionListener<ButtonEvent>() {

        @Override
        public void componentSelected(ButtonEvent ce) {
            newLocationPresenter.setActive(true, true);
        }
    });
    addLocationButton.addStyleName(SiteFormResources.INSTANCE.style().addLocationButton());
    if (isAddAllowed()) {
        container.add(addLocationHeader);
        container.add(addLocationHelp);
        container.add(addLocationButton);
    }
    BorderLayoutData layout = new BorderLayoutData(LayoutRegion.WEST);
    layout.setSize(350);
    add(container, layout);
}
Also used : FlowLayout(com.extjs.gxt.ui.client.widget.layout.FlowLayout) LayoutContainer(com.extjs.gxt.ui.client.widget.LayoutContainer) Button(com.extjs.gxt.ui.client.widget.button.Button) BorderLayoutData(com.extjs.gxt.ui.client.widget.layout.BorderLayoutData)

Aggregations

LayoutContainer (com.extjs.gxt.ui.client.widget.LayoutContainer)5 Text (com.extjs.gxt.ui.client.widget.Text)2 Button (com.extjs.gxt.ui.client.widget.button.Button)2 TextField (com.extjs.gxt.ui.client.widget.form.TextField)2 BorderLayoutData (com.extjs.gxt.ui.client.widget.layout.BorderLayoutData)2 HBoxLayout (com.extjs.gxt.ui.client.widget.layout.HBoxLayout)2 IndicatorDTO (org.activityinfo.legacy.shared.model.IndicatorDTO)2 Field (com.extjs.gxt.ui.client.widget.form.Field)1 NumberField (com.extjs.gxt.ui.client.widget.form.NumberField)1 BorderLayout (com.extjs.gxt.ui.client.widget.layout.BorderLayout)1 FlowLayout (com.extjs.gxt.ui.client.widget.layout.FlowLayout)1 HBoxLayoutData (com.extjs.gxt.ui.client.widget.layout.HBoxLayoutData)1 TableData (com.extjs.gxt.ui.client.widget.layout.TableData)1 TableLayout (com.extjs.gxt.ui.client.widget.layout.TableLayout)1 PivotGridPanel (org.activityinfo.ui.client.component.report.view.PivotGridPanel)1