Search in sources :

Example 16 with CheckBox

use of com.vaadin.v7.ui.CheckBox in project SORMAS-Project by hzi-braunschweig.

the class SampleController method setViaLimsFieldChecked.

public void setViaLimsFieldChecked(PathogenTestForm pathogenTestForm) {
    CheckBox viaLimsCheckbox = pathogenTestForm.getField(PathogenTestDto.VIA_LIMS);
    viaLimsCheckbox.setValue(Boolean.TRUE);
}
Also used : CheckBox(com.vaadin.v7.ui.CheckBox)

Example 17 with CheckBox

use of com.vaadin.v7.ui.CheckBox in project SORMAS-Project by hzi-braunschweig.

the class AbstractEpiCurveComponent method createFooter.

private HorizontalLayout createFooter() {
    HorizontalLayout epiCurveFooterLayout = new HorizontalLayout();
    epiCurveFooterLayout.setWidth(100, Unit.PERCENTAGE);
    epiCurveFooterLayout.setSpacing(true);
    CssStyles.style(epiCurveFooterLayout, CssStyles.VSPACE_4);
    // Grouping
    VerticalLayout groupingLayout = new VerticalLayout();
    {
        groupingLayout.setMargin(true);
        groupingLayout.setSizeUndefined();
        // Grouping option group
        OptionGroup groupingSelect = new OptionGroup();
        groupingSelect.setWidth(100, Unit.PERCENTAGE);
        groupingSelect.addItems((Object[]) EpiCurveGrouping.values());
        groupingSelect.setValue(epiCurveGrouping);
        groupingSelect.addValueChangeListener(e -> {
            epiCurveGrouping = (EpiCurveGrouping) e.getProperty().getValue();
            clearAndFillEpiCurveChart();
        });
        groupingLayout.addComponent(groupingSelect);
        // "Always show at least 7 entries" checkbox
        CheckBox minimumEntriesCheckbox = new CheckBox(I18nProperties.getCaption(Captions.dashboardShowMinimumEntries));
        CssStyles.style(minimumEntriesCheckbox, CssStyles.VSPACE_NONE);
        minimumEntriesCheckbox.setValue(showMinimumEntries);
        minimumEntriesCheckbox.addValueChangeListener(e -> {
            showMinimumEntries = (boolean) e.getProperty().getValue();
            clearAndFillEpiCurveChart();
        });
        groupingLayout.addComponent(minimumEntriesCheckbox);
    }
    PopupButton groupingDropdown = ButtonHelper.createPopupButton(Captions.dashboardGrouping, groupingLayout, CssStyles.BUTTON_SUBTLE);
    epiCurveFooterLayout.addComponent(groupingDropdown);
    epiCurveFooterLayout.setComponentAlignment(groupingDropdown, Alignment.MIDDLE_RIGHT);
    epiCurveFooterLayout.setExpandRatio(groupingDropdown, 1);
    // Epi curve mode
    AbstractComponent epiCurveModeSelector = createEpiCurveModeSelector();
    epiCurveFooterLayout.addComponent(epiCurveModeSelector);
    epiCurveFooterLayout.setComponentAlignment(epiCurveModeSelector, Alignment.MIDDLE_RIGHT);
    epiCurveFooterLayout.setExpandRatio(epiCurveModeSelector, 0);
    return epiCurveFooterLayout;
}
Also used : Date(java.util.Date) CheckBox(com.vaadin.v7.ui.CheckBox) I18nProperties(de.symeda.sormas.api.i18n.I18nProperties) VerticalLayout(com.vaadin.ui.VerticalLayout) Alignment(com.vaadin.ui.Alignment) DateHelper(de.symeda.sormas.api.utils.DateHelper) PopupButton(org.vaadin.hene.popupbutton.PopupButton) Captions(de.symeda.sormas.api.i18n.Captions) HighChart(de.symeda.sormas.ui.highcharts.HighChart) ArrayList(java.util.ArrayList) Consumer(java.util.function.Consumer) OptionGroup(com.vaadin.v7.ui.OptionGroup) DashboardDataProvider(de.symeda.sormas.ui.dashboard.DashboardDataProvider) List(java.util.List) Button(com.vaadin.ui.Button) AbstractComponent(com.vaadin.ui.AbstractComponent) CssStyles(de.symeda.sormas.ui.utils.CssStyles) HorizontalLayout(com.vaadin.ui.HorizontalLayout) Label(com.vaadin.ui.Label) VaadinIcons(com.vaadin.icons.VaadinIcons) Strings(de.symeda.sormas.api.i18n.Strings) EpiCurveGrouping(de.symeda.sormas.api.dashboard.EpiCurveGrouping) ButtonHelper(de.symeda.sormas.ui.utils.ButtonHelper) AbstractComponent(com.vaadin.ui.AbstractComponent) OptionGroup(com.vaadin.v7.ui.OptionGroup) PopupButton(org.vaadin.hene.popupbutton.PopupButton) CheckBox(com.vaadin.v7.ui.CheckBox) EpiCurveGrouping(de.symeda.sormas.api.dashboard.EpiCurveGrouping) VerticalLayout(com.vaadin.ui.VerticalLayout) HorizontalLayout(com.vaadin.ui.HorizontalLayout)

Example 18 with CheckBox

use of com.vaadin.v7.ui.CheckBox in project SORMAS-Project by hzi-braunschweig.

the class BulkEventDataForm method addFields.

@Override
protected void addFields() {
    eventStatusCheckBox = new CheckBox(I18nProperties.getCaption(Captions.bulkEventStatus));
    getContent().addComponent(eventStatusCheckBox, EVENT_STATUS_CHECKBOX);
    NullableOptionGroup eventStatus = addField(EventDto.EVENT_STATUS, NullableOptionGroup.class);
    eventStatus.setEnabled(false);
    FieldHelper.setRequiredWhen(getFieldGroup(), eventStatusCheckBox, Arrays.asList(EventDto.EVENT_STATUS), Arrays.asList(true));
    eventStatusCheckBox.addValueChangeListener(e -> {
        eventStatus.setEnabled((boolean) e.getProperty().getValue());
    });
    eventInvestigationStatusCheckbox = new CheckBox(I18nProperties.getCaption(Captions.bulkEventInvestigationStatus));
    getContent().addComponent(eventInvestigationStatusCheckbox, EVENT_INVESTIGATION_STATUS_CHECKBOX);
    NullableOptionGroup eventInvestigationStatus = addField(EventDto.EVENT_INVESTIGATION_STATUS, NullableOptionGroup.class);
    eventInvestigationStatus.setEnabled(false);
    FieldHelper.setRequiredWhen(getFieldGroup(), eventInvestigationStatusCheckbox, Arrays.asList(EventDto.EVENT_INVESTIGATION_STATUS), Arrays.asList(true));
    eventInvestigationStatusCheckbox.addValueChangeListener(e -> {
        eventInvestigationStatus.setEnabled((boolean) e.getProperty().getValue());
    });
    eventManagementStatusCheckbox = new CheckBox(I18nProperties.getCaption(Captions.bulkEventManagementStatus));
    getContent().addComponent(eventManagementStatusCheckbox, EVENT_MANAGEMENT_STATUS_CHECKBOX);
    NullableOptionGroup eventManagementStatus = addField(EventDto.EVENT_MANAGEMENT_STATUS, NullableOptionGroup.class);
    eventManagementStatus.setEnabled(false);
    FieldHelper.setRequiredWhen(getFieldGroup(), eventManagementStatusCheckbox, Arrays.asList(EventDto.EVENT_MANAGEMENT_STATUS), Arrays.asList(true));
    eventManagementStatusCheckbox.addValueChangeListener(e -> {
        eventManagementStatus.setEnabled((boolean) e.getProperty().getValue());
    });
}
Also used : NullableOptionGroup(de.symeda.sormas.ui.utils.NullableOptionGroup) CheckBox(com.vaadin.v7.ui.CheckBox)

Example 19 with CheckBox

use of com.vaadin.v7.ui.CheckBox in project SORMAS-Project by hzi-braunschweig.

the class SurveillanceOverviewLayout method addShowMoreAndLessButtons.

private void addShowMoreAndLessButtons() {
    HorizontalLayout buttonsLayout = new HorizontalLayout();
    buttonsLayout.setHeightUndefined();
    buttonsLayout.setWidth(100, Unit.PERCENTAGE);
    buttonsLayout.setMargin(new MarginInfo(false, true));
    showMoreButton = ButtonHelper.createIconButton(Captions.dashboardShowAllDiseases, VaadinIcons.CHEVRON_DOWN, null, ValoTheme.BUTTON_BORDERLESS, CssStyles.VSPACE_TOP_NONE, CssStyles.VSPACE_4);
    showLessButton = ButtonHelper.createIconButton(Captions.dashboardShowFirstDiseases, VaadinIcons.CHEVRON_UP, null, ValoTheme.BUTTON_BORDERLESS, CssStyles.VSPACE_TOP_NONE, CssStyles.VSPACE_4);
    hideOverview = new CheckBox(I18nProperties.getCaption(Captions.dashboardHideOverview));
    hideOverview.setId("hideOverview");
    CssStyles.style(hideOverview, CssStyles.VSPACE_3);
    showMoreButton.addClickListener(e -> {
        isShowingAllDiseases = true;
        refresh();
        showMoreButton.setVisible(false);
        showLessButton.setVisible(true);
    });
    showLessButton.addClickListener(e -> {
        isShowingAllDiseases = false;
        refresh();
        showLessButton.setVisible(false);
        showMoreButton.setVisible(true);
    });
    hideOverview.addValueChangeListener(e -> {
        if (hideOverview.getValue()) {
            diseaseOverviewComponent.setVisible(false);
            diseaseDifferenceComponent.setVisible(false);
            showLessButton.setVisible(false);
            showMoreButton.setVisible(false);
        } else {
            diseaseOverviewComponent.setVisible(true);
            diseaseDifferenceComponent.setVisible(true);
            showLessButton.setVisible(isShowingAllDiseases);
            showMoreButton.setVisible(!isShowingAllDiseases);
        }
    });
    buttonsLayout.addComponent(showMoreButton);
    buttonsLayout.addComponent(showLessButton);
    buttonsLayout.setComponentAlignment(showMoreButton, Alignment.BOTTOM_CENTER);
    buttonsLayout.setExpandRatio(showMoreButton, 1);
    buttonsLayout.setComponentAlignment(showLessButton, Alignment.BOTTOM_CENTER);
    buttonsLayout.setExpandRatio(showLessButton, 1);
    buttonsLayout.addComponent(hideOverview);
    buttonsLayout.setComponentAlignment(hideOverview, Alignment.BOTTOM_RIGHT);
    buttonsLayout.setExpandRatio(hideOverview, 0);
    addComponent(buttonsLayout, EXTEND_BUTTONS_LOC);
    isShowingAllDiseases = false;
    showLessButton.setVisible(false);
    buttonsLayout.setExpandRatio(showLessButton, 1);
}
Also used : MarginInfo(com.vaadin.shared.ui.MarginInfo) CheckBox(com.vaadin.v7.ui.CheckBox) HorizontalLayout(com.vaadin.ui.HorizontalLayout)

Example 20 with CheckBox

use of com.vaadin.v7.ui.CheckBox in project SORMAS-Project by hzi-braunschweig.

the class SurveillanceDiseaseCarouselLayout method setupSlideShow.

private CheckBox setupSlideShow() {
    // slideshow option
    CheckBox autoSlide = new CheckBox(I18nProperties.getCaption(Captions.dashboardDiseaseCarouselSlideShow));
    autoSlide.addValueChangeListener(e -> {
        this.changeAutoSlideOption(autoSlide.getValue());
    });
    // enabled by default
    autoSlide.setValue(false);
    return autoSlide;
}
Also used : CheckBox(com.vaadin.v7.ui.CheckBox)

Aggregations

CheckBox (com.vaadin.v7.ui.CheckBox)40 CheckBox (com.codename1.ui.CheckBox)18 Label (com.vaadin.ui.Label)15 ComboBox (com.vaadin.v7.ui.ComboBox)14 Button (com.codename1.ui.Button)12 TextField (com.vaadin.v7.ui.TextField)12 I18nProperties (de.symeda.sormas.api.i18n.I18nProperties)12 Form (com.codename1.ui.Form)11 Disease (de.symeda.sormas.api.Disease)11 Captions (de.symeda.sormas.api.i18n.Captions)11 DistrictReferenceDto (de.symeda.sormas.api.infrastructure.district.DistrictReferenceDto)11 NullableOptionGroup (de.symeda.sormas.ui.utils.NullableOptionGroup)11 List (java.util.List)11 Container (com.codename1.ui.Container)10 FacadeProvider (de.symeda.sormas.api.FacadeProvider)10 Strings (de.symeda.sormas.api.i18n.Strings)10 Label (com.codename1.ui.Label)9 TextField (com.codename1.ui.TextField)9 HorizontalLayout (com.vaadin.ui.HorizontalLayout)9 AbstractEditForm (de.symeda.sormas.ui.utils.AbstractEditForm)9