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);
}
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;
}
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());
});
}
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);
}
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;
}
Aggregations