use of com.vaadin.v7.ui.CheckBox in project SORMAS-Project by hzi-braunschweig.
the class BulkContactDataForm method addFields.
@Override
protected void addFields() {
if (!initialized) {
return;
}
classificationCheckBox = new CheckBox(I18nProperties.getCaption(Captions.bulkContactClassification));
getContent().addComponent(classificationCheckBox, CLASSIFICATION_CHECKBOX);
NullableOptionGroup contactClassification = addField(ContactBulkEditData.CONTACT_CLASSIFICATION, NullableOptionGroup.class);
contactClassification.setEnabled(false);
if (singleSelectedDistrict != null) {
contactOfficerCheckBox = new CheckBox(I18nProperties.getCaption(Captions.bulkContactOfficer));
getContent().addComponent(contactOfficerCheckBox, CONTACT_OFFICER_CHECKBOX);
ComboBox contactOfficer = addField(ContactBulkEditData.CONTACT_OFFICER, ComboBox.class);
contactOfficer.setEnabled(false);
FieldHelper.addSoftRequiredStyleWhen(getFieldGroup(), contactOfficerCheckBox, Arrays.asList(ContactBulkEditData.CONTACT_OFFICER), Arrays.asList(true), null);
Set<Disease> selectedDiseases = this.selectedContacts.stream().map(c -> c.getDisease()).collect(Collectors.toSet());
List<UserReferenceDto> assignableContactOfficers = null;
if (selectedDiseases.size() == 1) {
Disease selectedDisease = selectedDiseases.iterator().next();
assignableContactOfficers = FacadeProvider.getUserFacade().getUserRefsByDistrict(singleSelectedDistrict, selectedDisease, UserRight.CONTACT_RESPONSIBLE);
} else {
assignableContactOfficers = FacadeProvider.getUserFacade().getUserRefsByDistrict(singleSelectedDistrict, true, UserRight.CONTACT_RESPONSIBLE);
}
FieldHelper.updateItems(contactOfficer, assignableContactOfficers);
contactOfficerCheckBox.addValueChangeListener(e -> {
contactOfficer.setEnabled((boolean) e.getProperty().getValue());
});
}
FieldHelper.setRequiredWhen(getFieldGroup(), classificationCheckBox, Arrays.asList(ContactBulkEditData.CONTACT_CLASSIFICATION), Arrays.asList(true));
classificationCheckBox.addValueChangeListener(e -> {
contactClassification.setEnabled((boolean) e.getProperty().getValue());
});
}
use of com.vaadin.v7.ui.CheckBox in project SORMAS-Project by hzi-braunschweig.
the class PathogenTestForm method addFields.
@Override
protected void addFields() {
if (sample == null) {
return;
}
pathogenTestHeadingLabel = new Label();
pathogenTestHeadingLabel.addStyleName(H3);
getContent().addComponent(pathogenTestHeadingLabel, PATHOGEN_TEST_HEADING_LOC);
addDateField(PathogenTestDto.REPORT_DATE, DateField.class, 0);
addField(PathogenTestDto.VIA_LIMS);
addField(PathogenTestDto.EXTERNAL_ID);
addField(PathogenTestDto.EXTERNAL_ORDER_ID);
ComboBox testTypeField = addField(PathogenTestDto.TEST_TYPE, ComboBox.class);
testTypeField.setItemCaptionMode(ItemCaptionMode.ID_TOSTRING);
testTypeField.setImmediate(true);
pcrTestSpecification = addField(PathogenTestDto.PCR_TEST_SPECIFICATION, ComboBox.class);
testTypeTextField = addField(PathogenTestDto.TEST_TYPE_TEXT, TextField.class);
FieldHelper.addSoftRequiredStyle(testTypeTextField);
DateTimeField sampleTestDateField = addField(PathogenTestDto.TEST_DATE_TIME, DateTimeField.class);
sampleTestDateField.addValidator(new DateComparisonValidator(sampleTestDateField, sample.getSampleDateTime(), false, false, I18nProperties.getValidationError(Validations.afterDateWithDate, sampleTestDateField.getCaption(), I18nProperties.getPrefixCaption(SampleDto.I18N_PREFIX, SampleDto.SAMPLE_DATE_TIME), DateFormatHelper.formatDate(sample.getSampleDateTime()))));
ComboBox lab = addInfrastructureField(PathogenTestDto.LAB);
lab.addItems(FacadeProvider.getFacilityFacade().getAllActiveLaboratories(true));
TextField labDetails = addField(PathogenTestDto.LAB_DETAILS, TextField.class);
labDetails.setVisible(false);
typingIdField = addField(PathogenTestDto.TYPING_ID, TextField.class);
typingIdField.setVisible(false);
ComboBox diseaseField = addDiseaseField(PathogenTestDto.TESTED_DISEASE, true, create);
ComboBox diseaseVariantField = addField(PathogenTestDto.TESTED_DISEASE_VARIANT, ComboBox.class);
diseaseVariantField.setNullSelectionAllowed(true);
addField(PathogenTestDto.TESTED_DISEASE_DETAILS, TextField.class);
TextField diseaseVariantDetailsField = addField(PathogenTestDto.TESTED_DISEASE_VARIANT_DETAILS, TextField.class);
diseaseVariantDetailsField.setVisible(false);
ComboBox testResultField = addField(PathogenTestDto.TEST_RESULT, ComboBox.class);
testResultField.removeItem(PathogenTestResultType.NOT_DONE);
addField(PathogenTestDto.SEROTYPE, TextField.class);
TextField cqValueField = addField(PathogenTestDto.CQ_VALUE, TextField.class);
cqValueField.setConversionError(I18nProperties.getValidationError(Validations.onlyNumbersAllowed, cqValueField.getCaption()));
NullableOptionGroup testResultVerifiedField = addField(PathogenTestDto.TEST_RESULT_VERIFIED, NullableOptionGroup.class);
testResultVerifiedField.setRequired(true);
CheckBox fourFoldIncrease = addField(PathogenTestDto.FOUR_FOLD_INCREASE_ANTIBODY_TITER, CheckBox.class);
CssStyles.style(fourFoldIncrease, VSPACE_3, VSPACE_TOP_4);
fourFoldIncrease.setVisible(false);
fourFoldIncrease.setEnabled(false);
addField(PathogenTestDto.TEST_RESULT_TEXT, TextArea.class).setRows(6);
addField(PathogenTestDto.PRELIMINARY).addStyleName(CssStyles.VSPACE_4);
addField(PathogenTestDto.DELETION_REASON);
addField(PathogenTestDto.OTHER_DELETION_REASON, TextArea.class).setRows(3);
setVisible(false, PathogenTestDto.DELETION_REASON, PathogenTestDto.OTHER_DELETION_REASON);
initializeAccessAndAllowedAccesses();
initializeVisibilitiesAndAllowedVisibilities();
pcrTestSpecification.setVisible(false);
Map<Object, List<Object>> pcrTestSpecificationVisibilityDependencies = new HashMap<Object, List<Object>>() {
{
put(PathogenTestDto.TESTED_DISEASE, Arrays.asList(Disease.CORONAVIRUS));
put(PathogenTestDto.TEST_TYPE, Arrays.asList(PathogenTestType.PCR_RT_PCR));
}
};
FieldHelper.setVisibleWhen(getFieldGroup(), PathogenTestDto.PCR_TEST_SPECIFICATION, pcrTestSpecificationVisibilityDependencies, true);
FieldHelper.setVisibleWhen(getFieldGroup(), PathogenTestDto.TEST_TYPE_TEXT, PathogenTestDto.TEST_TYPE, Arrays.asList(PathogenTestType.PCR_RT_PCR, PathogenTestType.OTHER), true);
FieldHelper.setVisibleWhen(getFieldGroup(), PathogenTestDto.TESTED_DISEASE_DETAILS, PathogenTestDto.TESTED_DISEASE, Arrays.asList(Disease.OTHER), true);
FieldHelper.setVisibleWhen(getFieldGroup(), PathogenTestDto.TYPING_ID, PathogenTestDto.TEST_TYPE, Arrays.asList(PathogenTestType.PCR_RT_PCR, PathogenTestType.DNA_MICROARRAY, PathogenTestType.SEQUENCING), true);
Map<Object, List<Object>> serotypeVisibilityDependencies = new HashMap<Object, List<Object>>() {
private static final long serialVersionUID = 1967952323596082247L;
{
put(PathogenTestDto.TESTED_DISEASE, Arrays.asList(Disease.CSM));
put(PathogenTestDto.TEST_RESULT, Arrays.asList(PathogenTestResultType.POSITIVE));
}
};
FieldHelper.setVisibleWhen(getFieldGroup(), PathogenTestDto.SEROTYPE, serotypeVisibilityDependencies, true);
FieldHelper.setVisibleWhen(getFieldGroup(), PathogenTestDto.CQ_VALUE, PathogenTestDto.TEST_TYPE, Arrays.asList(PathogenTestType.CQ_VALUE_DETECTION), true);
Consumer<Disease> updateDiseaseVariantField = disease -> {
List<DiseaseVariant> diseaseVariants = FacadeProvider.getCustomizableEnumFacade().getEnumValues(CustomizableEnumType.DISEASE_VARIANT, disease);
FieldHelper.updateItems(diseaseVariantField, diseaseVariants);
diseaseVariantField.setVisible(disease != null && isVisibleAllowed(PathogenTestDto.TESTED_DISEASE_VARIANT) && CollectionUtils.isNotEmpty(diseaseVariants));
};
// trigger the update, as the disease may already be set
updateDiseaseVariantField.accept((Disease) diseaseField.getValue());
diseaseField.addValueChangeListener((ValueChangeListener) valueChangeEvent -> {
Disease disease = (Disease) valueChangeEvent.getProperty().getValue();
updateDiseaseVariantField.accept(disease);
FieldHelper.updateItems(testTypeField, Arrays.asList(PathogenTestType.values()), FieldVisibilityCheckers.withDisease(disease), PathogenTestType.class);
});
diseaseVariantField.addValueChangeListener(e -> {
DiseaseVariant diseaseVariant = (DiseaseVariant) e.getProperty().getValue();
diseaseVariantDetailsField.setVisible(diseaseVariant != null && diseaseVariant.matchPropertyValue(DiseaseVariant.HAS_DETAILS, true));
});
testTypeField.addValueChangeListener(e -> {
PathogenTestType testType = (PathogenTestType) e.getProperty().getValue();
if (testType == PathogenTestType.IGM_SERUM_ANTIBODY || testType == PathogenTestType.IGG_SERUM_ANTIBODY) {
fourFoldIncrease.setVisible(true);
fourFoldIncrease.setEnabled(caseSampleCount >= 2);
} else {
fourFoldIncrease.setVisible(false);
fourFoldIncrease.setEnabled(false);
}
});
lab.addValueChangeListener(event -> {
if (event.getProperty().getValue() != null && ((FacilityReferenceDto) event.getProperty().getValue()).getUuid().equals(FacilityDto.OTHER_FACILITY_UUID)) {
labDetails.setVisible(true);
labDetails.setRequired(true);
} else {
labDetails.setVisible(false);
labDetails.setRequired(false);
labDetails.clear();
}
});
testTypeField.addValueChangeListener(e -> {
PathogenTestType testType = (PathogenTestType) e.getProperty().getValue();
if ((testType == PathogenTestType.PCR_RT_PCR && testResultField.getValue() == PathogenTestResultType.POSITIVE) || testType == PathogenTestType.CQ_VALUE_DETECTION) {
cqValueField.setVisible(true);
} else {
cqValueField.setVisible(false);
cqValueField.clear();
}
});
testResultField.addValueChangeListener(e -> {
PathogenTestResultType testResult = (PathogenTestResultType) e.getProperty().getValue();
if ((testTypeField.getValue() == PathogenTestType.PCR_RT_PCR && testResult == PathogenTestResultType.POSITIVE) || testTypeField.getValue() == PathogenTestType.CQ_VALUE_DETECTION) {
cqValueField.setVisible(true);
} else {
cqValueField.setVisible(false);
cqValueField.clear();
}
});
if (sample.getSamplePurpose() != SamplePurpose.INTERNAL) {
// this only works for already saved samples
setRequired(true, PathogenTestDto.LAB);
}
setRequired(true, PathogenTestDto.TEST_TYPE, PathogenTestDto.TESTED_DISEASE, PathogenTestDto.TEST_RESULT);
}
use of com.vaadin.v7.ui.CheckBox in project SORMAS-Project by hzi-braunschweig.
the class AbstractSampleForm method initializeRequestedTestFields.
protected void initializeRequestedTestFields() {
// Information texts for users that can edit the requested tests
Label requestedPathogenInfoLabel = new Label(I18nProperties.getString(Strings.infoSamplePathogenTesting));
getContent().addComponent(requestedPathogenInfoLabel, PATHOGEN_TESTING_INFO_LOC);
Label requestedAdditionalInfoLabel = new Label(I18nProperties.getString(Strings.infoSampleAdditionalTesting));
getContent().addComponent(requestedAdditionalInfoLabel, ADDITIONAL_TESTING_INFO_LOC);
// Yes/No fields for requesting pathogen/additional tests
CheckBox pathogenTestingRequestedField = addField(SampleDto.PATHOGEN_TESTING_REQUESTED, CheckBox.class);
pathogenTestingRequestedField.setWidthUndefined();
pathogenTestingRequestedField.addValueChangeListener(e -> updateRequestedTestFields());
CheckBox additionalTestingRequestedField = addField(SampleDto.ADDITIONAL_TESTING_REQUESTED, CheckBox.class);
additionalTestingRequestedField.setWidthUndefined();
additionalTestingRequestedField.addValueChangeListener(e -> updateRequestedTestFields());
// CheckBox groups to select the requested pathogen/additional tests
OptionGroup requestedPathogenTestsField = addField(SampleDto.REQUESTED_PATHOGEN_TESTS, OptionGroup.class);
CssStyles.style(requestedPathogenTestsField, CssStyles.OPTIONGROUP_CHECKBOXES_HORIZONTAL);
requestedPathogenTestsField.setMultiSelect(true);
requestedPathogenTestsField.addItems(Arrays.stream(PathogenTestType.values()).filter(c -> fieldVisibilityCheckers.isVisible(PathogenTestType.class, c.name())).collect(Collectors.toList()));
requestedPathogenTestsField.removeItem(PathogenTestType.OTHER);
requestedPathogenTestsField.setCaption(null);
OptionGroup requestedAdditionalTestsField = addField(SampleDto.REQUESTED_ADDITIONAL_TESTS, OptionGroup.class);
CssStyles.style(requestedAdditionalTestsField, CssStyles.OPTIONGROUP_CHECKBOXES_HORIZONTAL);
requestedAdditionalTestsField.setMultiSelect(true);
requestedAdditionalTestsField.addItems((Object[]) AdditionalTestType.values());
requestedAdditionalTestsField.setCaption(null);
// Text fields to type in other tests
TextField requestedOtherPathogenTests = addField(SampleDto.REQUESTED_OTHER_PATHOGEN_TESTS, TextField.class);
TextField requestedOtherAdditionalTests = addField(SampleDto.REQUESTED_OTHER_ADDITIONAL_TESTS, TextField.class);
// header for read view
Label pathogenTestsHeading = new Label(I18nProperties.getString(Strings.headingRequestedPathogenTests));
CssStyles.style(pathogenTestsHeading, CssStyles.LABEL_BOLD, CssStyles.LABEL_SECONDARY, VSPACE_4);
getContent().addComponent(pathogenTestsHeading, PATHOGEN_TESTING_READ_HEADLINE_LOC);
Label additionalTestsHeading = new Label(I18nProperties.getString(Strings.headingRequestedAdditionalTests));
CssStyles.style(additionalTestsHeading, CssStyles.LABEL_BOLD, CssStyles.LABEL_SECONDARY, VSPACE_4);
getContent().addComponent(additionalTestsHeading, ADDITIONAL_TESTING_READ_HEADLINE_LOC);
updateRequestedTestFields();
}
use of com.vaadin.v7.ui.CheckBox in project SORMAS-Project by hzi-braunschweig.
the class DashboardMapComponent method createFooter.
private HorizontalLayout createFooter() {
HorizontalLayout mapFooterLayout = new HorizontalLayout();
mapFooterLayout.setWidth(100, Unit.PERCENTAGE);
mapFooterLayout.setSpacing(true);
CssStyles.style(mapFooterLayout, CssStyles.VSPACE_4, CssStyles.VSPACE_TOP_3);
// Map key dropdown button
legendDropdown = ButtonHelper.createPopupButton(Captions.dashboardMapKey, null, CssStyles.BUTTON_SUBTLE);
legendDropdown.setContent(createLegend());
mapFooterLayout.addComponent(legendDropdown);
mapFooterLayout.setComponentAlignment(legendDropdown, Alignment.MIDDLE_RIGHT);
mapFooterLayout.setExpandRatio(legendDropdown, 1);
// Layers dropdown button
VerticalLayout layersLayout = new VerticalLayout();
{
layersLayout.setMargin(true);
layersLayout.setSpacing(false);
layersLayout.setSizeUndefined();
// Add check boxes and apply button
{
// case classifications
OptionGroup caseClassificationOptions = new OptionGroup();
caseClassificationOptions.addItems((Object[]) MapCaseClassificationOption.values());
caseClassificationOptions.setValue(caseClassificationOption);
caseClassificationOptions.addValueChangeListener(event -> {
caseClassificationOption = (MapCaseClassificationOption) event.getProperty().getValue();
refreshMap(true);
});
// Optiongroup to select what property the coordinates should be based on
OptionGroup mapCaseDisplayModeSelect = new OptionGroup();
mapCaseDisplayModeSelect.setWidth(100, Unit.PERCENTAGE);
mapCaseDisplayModeSelect.addItems((Object[]) MapCaseDisplayMode.values());
mapCaseDisplayModeSelect.setValue(mapCaseDisplayMode);
mapCaseDisplayModeSelect.addValueChangeListener(event -> {
mapCaseDisplayMode = (MapCaseDisplayMode) event.getProperty().getValue();
refreshMap(true);
});
HorizontalLayout showCasesLayout = new HorizontalLayout();
{
showCasesLayout.setMargin(false);
showCasesLayout.setSpacing(false);
CheckBox showCasesCheckBox = new CheckBox();
showCasesCheckBox.setId(Captions.dashboardShowCases);
showCasesCheckBox.setCaption(I18nProperties.getCaption(Captions.dashboardShowCases));
showCasesCheckBox.setValue(showCases);
showCasesCheckBox.addValueChangeListener(e -> {
showCases = (boolean) e.getProperty().getValue();
mapCaseDisplayModeSelect.setEnabled(showCases);
mapCaseDisplayModeSelect.setValue(mapCaseDisplayMode);
caseClassificationOptions.setEnabled(showCases);
refreshMap(true);
});
showCasesLayout.addComponent(showCasesCheckBox);
Label infoLabel = new Label(VaadinIcons.INFO_CIRCLE.getHtml(), ContentMode.HTML);
infoLabel.setDescription(I18nProperties.getString(Strings.infoCaseMap));
CssStyles.style(infoLabel, CssStyles.LABEL_MEDIUM, CssStyles.LABEL_SECONDARY, CssStyles.HSPACE_LEFT_3);
infoLabel.setHeightUndefined();
showCasesLayout.addComponent(infoLabel);
showCasesLayout.setComponentAlignment(infoLabel, Alignment.TOP_CENTER);
}
layersLayout.addComponent(showCasesLayout);
layersLayout.addComponent(mapCaseDisplayModeSelect);
mapCaseDisplayModeSelect.setEnabled(showCases);
layersLayout.addComponent(caseClassificationOptions);
caseClassificationOptions.setEnabled(showCases);
CheckBox showConfirmedContactsCheckBox = new CheckBox();
showConfirmedContactsCheckBox.setId(Captions.dashboardShowConfirmedContacts);
CheckBox showUnconfirmedContactsCheckBox = new CheckBox();
showUnconfirmedContactsCheckBox.setId(Captions.dashboardShowUnconfirmedContacts);
CheckBox showContactsCheckBox = new CheckBox();
showContactsCheckBox.setId(Captions.dashboardShowContacts);
showContactsCheckBox.setCaption(I18nProperties.getCaption(Captions.dashboardShowContacts));
showContactsCheckBox.setValue(showContacts);
showContactsCheckBox.addValueChangeListener(e -> {
showContacts = (boolean) e.getProperty().getValue();
showConfirmedContactsCheckBox.setEnabled(showContacts);
showConfirmedContactsCheckBox.setValue(true);
showUnconfirmedContactsCheckBox.setEnabled(showContacts);
showUnconfirmedContactsCheckBox.setValue(true);
refreshMap(true);
});
layersLayout.addComponent(showContactsCheckBox);
showConfirmedContactsCheckBox.setCaption(I18nProperties.getCaption(Captions.dashboardShowConfirmedContacts));
showConfirmedContactsCheckBox.setValue(showConfirmedContacts);
showConfirmedContactsCheckBox.addValueChangeListener(e -> {
showConfirmedContacts = (boolean) e.getProperty().getValue();
refreshMap(true);
});
layersLayout.addComponent(showConfirmedContactsCheckBox);
CssStyles.style(showUnconfirmedContactsCheckBox, CssStyles.VSPACE_3);
showUnconfirmedContactsCheckBox.setCaption(I18nProperties.getCaption(Captions.dashboardShowUnconfirmedContacts));
showUnconfirmedContactsCheckBox.setValue(showUnconfirmedContacts);
showUnconfirmedContactsCheckBox.addValueChangeListener(e -> {
showUnconfirmedContacts = (boolean) e.getProperty().getValue();
refreshMap(true);
});
layersLayout.addComponent(showUnconfirmedContactsCheckBox);
showConfirmedContactsCheckBox.setEnabled(showContacts);
showUnconfirmedContactsCheckBox.setEnabled(showContacts);
CheckBox showEventsCheckBox = new CheckBox();
showEventsCheckBox.setId(Captions.dashboardShowEvents);
CssStyles.style(showEventsCheckBox, CssStyles.VSPACE_3);
showEventsCheckBox.setCaption(I18nProperties.getCaption(Captions.dashboardShowEvents));
showEventsCheckBox.setValue(showEvents);
showEventsCheckBox.addValueChangeListener(e -> {
showEvents = (boolean) e.getProperty().getValue();
refreshMap(true);
});
layersLayout.addComponent(showEventsCheckBox);
if (nonNull(UserProvider.getCurrent()) && UserProvider.getCurrent().hasNationJurisdictionLevel()) {
OptionGroup regionMapVisualizationSelect = new OptionGroup();
regionMapVisualizationSelect.setWidth(100, Unit.PERCENTAGE);
regionMapVisualizationSelect.addItems((Object[]) CaseMeasure.values());
regionMapVisualizationSelect.setValue(caseMeasure);
regionMapVisualizationSelect.addValueChangeListener(event -> {
caseMeasure = (CaseMeasure) event.getProperty().getValue();
refreshMap(true);
});
HorizontalLayout showRegionsLayout = new HorizontalLayout();
{
showRegionsLayout.setMargin(false);
showRegionsLayout.setSpacing(false);
CheckBox showRegionsCheckBox = new CheckBox();
showRegionsCheckBox.setId(Captions.dashboardShowRegions);
showRegionsCheckBox.setCaption(I18nProperties.getCaption(Captions.dashboardShowRegions));
showRegionsCheckBox.setValue(showRegions);
showRegionsCheckBox.addValueChangeListener(e -> {
showRegions = (boolean) e.getProperty().getValue();
regionMapVisualizationSelect.setEnabled(showRegions);
regionMapVisualizationSelect.setValue(caseMeasure);
refreshMap(true);
});
showRegionsLayout.addComponent(showRegionsCheckBox);
Label infoLabel = new Label(VaadinIcons.INFO_CIRCLE.getHtml(), ContentMode.HTML);
infoLabel.setDescription(I18nProperties.getString(Strings.infoCaseIncidence));
CssStyles.style(infoLabel, CssStyles.LABEL_MEDIUM, CssStyles.LABEL_SECONDARY, CssStyles.HSPACE_LEFT_3);
infoLabel.setHeightUndefined();
showRegionsLayout.addComponent(infoLabel);
showRegionsLayout.setComponentAlignment(infoLabel, Alignment.TOP_CENTER);
}
layersLayout.addComponent(showRegionsLayout);
layersLayout.addComponent(regionMapVisualizationSelect);
regionMapVisualizationSelect.setEnabled(showRegions);
}
CheckBox hideOtherCountriesCheckBox = new CheckBox();
hideOtherCountriesCheckBox.setId(Captions.dashboardHideOtherCountries);
hideOtherCountriesCheckBox.setCaption(I18nProperties.getCaption(Captions.dashboardHideOtherCountries));
hideOtherCountriesCheckBox.setValue(hideOtherCountries);
hideOtherCountriesCheckBox.addValueChangeListener(e -> {
hideOtherCountries = (boolean) e.getProperty().getValue();
refreshMap(true);
});
CssStyles.style(hideOtherCountriesCheckBox, CssStyles.VSPACE_3);
layersLayout.addComponent(hideOtherCountriesCheckBox);
CheckBox showCurrentEpiSituationCB = new CheckBox();
showCurrentEpiSituationCB.setId(Captions.dashboardMapShowEpiSituation);
showCurrentEpiSituationCB.setCaption(I18nProperties.getCaption(Captions.dashboardMapShowEpiSituation));
showCurrentEpiSituationCB.setValue(false);
showCurrentEpiSituationCB.addValueChangeListener(e -> {
showCurrentEpiSituation = (boolean) e.getProperty().getValue();
refreshMap(true);
});
layersLayout.addComponent(showCurrentEpiSituationCB);
}
}
PopupButton layersDropdown = ButtonHelper.createPopupButton(Captions.dashboardMapLayers, layersLayout, CssStyles.BUTTON_SUBTLE);
mapFooterLayout.addComponent(layersDropdown);
mapFooterLayout.setComponentAlignment(layersDropdown, Alignment.MIDDLE_RIGHT);
return mapFooterLayout;
}
use of com.vaadin.v7.ui.CheckBox in project SORMAS-Project by hzi-braunschweig.
the class SurveillanceDiseaseCarouselLayout method createCarouselMenuLayout.
private HorizontalLayout createCarouselMenuLayout() {
HorizontalLayout layout = new HorizontalLayout();
layout.setMargin(false);
CssStyles.style(layout, CssStyles.HSPACE_LEFT_2);
CheckBox autoSlide = this.setupSlideShow();
layout.addComponent(autoSlide);
layout.setComponentAlignment(autoSlide, Alignment.MIDDLE_LEFT);
carouselMenu = new SubMenu();
for (Disease disease : diseases) {
carouselMenu.addView(disease.getName(), disease.toShortString(), (e) -> {
this.changeSelectedDisease(disease, true);
});
}
if (diseases.size() > 0) {
this.setActiveDisease(diseases.get(0), false);
}
layout.addComponent(carouselMenu);
return layout;
}
Aggregations