Search in sources :

Example 1 with OccupationType

use of de.symeda.sormas.api.person.OccupationType in project SORMAS-Project by hzi-braunschweig.

the class PersonEditFragment method setOccupationDetailsFieldVisibility.

private static void setOccupationDetailsFieldVisibility(final ControlPropertyField occupationTypeField, final ControlPropertyField occupationDetailsField) {
    OccupationType selectedOccupationType = (OccupationType) occupationTypeField.getValue();
    if (selectedOccupationType != null) {
        switch(selectedOccupationType) {
            case BUSINESSMAN_WOMAN:
                occupationDetailsField.setVisibility(VISIBLE);
                occupationDetailsField.setCaption(I18nProperties.getCaption(PersonDto.I18N_PREFIX + ".business." + PersonDto.OCCUPATION_DETAILS));
                break;
            case TRANSPORTER:
                occupationDetailsField.setVisibility(VISIBLE);
                occupationDetailsField.setCaption(I18nProperties.getCaption(PersonDto.I18N_PREFIX + ".transporter." + PersonDto.OCCUPATION_DETAILS));
                break;
            case HEALTHCARE_WORKER:
                occupationDetailsField.setVisibility(VISIBLE);
                occupationDetailsField.setCaption(I18nProperties.getCaption(PersonDto.I18N_PREFIX + ".healthcare." + PersonDto.OCCUPATION_DETAILS));
                break;
            case OTHER:
                occupationDetailsField.setVisibility(VISIBLE);
                occupationDetailsField.setCaption(I18nProperties.getPrefixCaption(PersonDto.I18N_PREFIX, PersonDto.OCCUPATION_DETAILS));
                break;
            default:
                occupationDetailsField.setVisibility(GONE);
                break;
        }
    } else {
        occupationDetailsField.setVisibility(GONE);
    }
}
Also used : OccupationType(de.symeda.sormas.api.person.OccupationType)

Aggregations

OccupationType (de.symeda.sormas.api.person.OccupationType)1