Search in sources :

Example 1 with GeneratedPropertyContainer

use of com.vaadin.v7.data.util.GeneratedPropertyContainer in project SORMAS-Project by hzi-braunschweig.

the class CaseSelectionGrid method buildGrid.

private void buildGrid() {
    setSizeFull();
    setSelectionMode(SelectionMode.SINGLE);
    setHeightMode(HeightMode.ROW);
    BeanItemContainer<CaseSelectionDto> container = new BeanItemContainer<>(CaseSelectionDto.class);
    GeneratedPropertyContainer generatedContainer = new GeneratedPropertyContainer(container);
    setContainerDataSource(generatedContainer);
    setColumns(CaseSelectionDto.UUID, CaseSelectionDto.EPID_NUMBER, CaseSelectionDto.EXTERNAL_ID, CaseSelectionDto.PERSON_FIRST_NAME, CaseSelectionDto.PERSON_LAST_NAME, CaseSelectionDto.AGE_AND_BIRTH_DATE, CaseSelectionDto.RESPONSIBLE_DISTRICT_NAME, CaseSelectionDto.HEALTH_FACILITY_NAME, CaseSelectionDto.REPORT_DATE, CaseSelectionDto.SEX, CaseSelectionDto.CASE_CLASSIFICATION, CaseSelectionDto.OUTCOME);
    if (FacadeProvider.getConfigFacade().isConfiguredCountry(CountryHelper.COUNTRY_CODE_GERMANY)) {
        getColumn(CaseSelectionDto.EPID_NUMBER).setHidden(true);
    } else {
        getColumn(CaseSelectionDto.EXTERNAL_ID).setHidden(true);
    }
    getColumn(CaseSelectionDto.UUID).setRenderer(new V7UuidRenderer());
    getColumn(CaseSelectionDto.AGE_AND_BIRTH_DATE).setConverter(new AgeAndBirthDateDtoConverterV7());
    getColumn(CaseSelectionDto.REPORT_DATE).setRenderer(new DateRenderer(DateHelper.getLocalDateTimeFormat(I18nProperties.getUserLanguage())));
    for (Column column : getColumns()) {
        column.setHeaderCaption(I18nProperties.getPrefixCaption(CaseSelectionDto.I18N_PREFIX, column.getPropertyId().toString(), column.getHeaderCaption()));
    }
}
Also used : CaseSelectionDto(de.symeda.sormas.api.caze.CaseSelectionDto) GeneratedPropertyContainer(com.vaadin.v7.data.util.GeneratedPropertyContainer) AgeAndBirthDateDtoConverterV7(de.symeda.sormas.ui.utils.AgeAndBirthDateDtoConverterV7) BeanItemContainer(com.vaadin.v7.data.util.BeanItemContainer) DateRenderer(com.vaadin.v7.ui.renderers.DateRenderer) V7UuidRenderer(de.symeda.sormas.ui.utils.V7UuidRenderer)

Example 2 with GeneratedPropertyContainer

use of com.vaadin.v7.data.util.GeneratedPropertyContainer in project SORMAS-Project by hzi-braunschweig.

the class PersonSelectionGrid method buildGrid.

private void buildGrid() {
    setSizeFull();
    setSelectionMode(SelectionMode.SINGLE);
    setHeightMode(HeightMode.ROW);
    BeanItemContainer<SimilarPersonDto> container = new BeanItemContainer<>(SimilarPersonDto.class);
    GeneratedPropertyContainer generatedContainer = new GeneratedPropertyContainer(container);
    setContainerDataSource(generatedContainer);
    setColumns(SimilarPersonDto.class, Arrays.asList(SimilarPersonDto.FIRST_NAME, SimilarPersonDto.LAST_NAME, SimilarPersonDto.NICKNAME, SimilarPersonDto.AGE_AND_BIRTH_DATE, SimilarPersonDto.SEX, SimilarPersonDto.PRESENT_CONDITION, SimilarPersonDto.PHONE, SimilarPersonDto.DISTRICT_NAME, SimilarPersonDto.COMMUNITY_NAME, SimilarPersonDto.POSTAL_CODE, SimilarPersonDto.CITY, SimilarPersonDto.STREET, SimilarPersonDto.HOUSE_NUMBER, SimilarPersonDto.NATIONAL_HEALTH_ID, SimilarPersonDto.PASSPORT_NUMBER));
    for (Column column : getColumns()) {
        String propertyId = column.getPropertyId().toString();
        String i18nPrefix = SimilarPersonDto.getI18nPrefix(propertyId);
        column.setHeaderCaption(I18nProperties.getPrefixCaption(i18nPrefix, propertyId, column.getHeaderCaption()));
    }
    getColumn(SimilarPersonDto.FIRST_NAME).setMinimumWidth(150);
    getColumn(SimilarPersonDto.LAST_NAME).setMinimumWidth(150);
}
Also used : GeneratedPropertyContainer(com.vaadin.v7.data.util.GeneratedPropertyContainer) BeanItemContainer(com.vaadin.v7.data.util.BeanItemContainer) SimilarPersonDto(de.symeda.sormas.api.person.SimilarPersonDto)

Example 3 with GeneratedPropertyContainer

use of com.vaadin.v7.data.util.GeneratedPropertyContainer in project SORMAS-Project by hzi-braunschweig.

the class EventParticipantSelectionGrid method buildGrid.

private void buildGrid() {
    setSizeFull();
    setSelectionMode(SelectionMode.SINGLE);
    setHeightMode(HeightMode.ROW);
    BeanItemContainer<SimilarEventParticipantDto> container = new BeanItemContainer(SimilarEventParticipantDto.class);
    GeneratedPropertyContainer generatedContainer = new GeneratedPropertyContainer(container);
    setContainerDataSource(generatedContainer);
    setColumns();
}
Also used : GeneratedPropertyContainer(com.vaadin.v7.data.util.GeneratedPropertyContainer) BeanItemContainer(com.vaadin.v7.data.util.BeanItemContainer) SimilarEventParticipantDto(de.symeda.sormas.api.event.SimilarEventParticipantDto)

Example 4 with GeneratedPropertyContainer

use of com.vaadin.v7.data.util.GeneratedPropertyContainer in project SORMAS-Project by hzi-braunschweig.

the class ContactSelectionGrid method buildGrid.

private void buildGrid() {
    setSizeFull();
    setSelectionMode(SelectionMode.SINGLE);
    setHeightMode(HeightMode.ROW);
    BeanItemContainer<SimilarContactDto> container = new BeanItemContainer<>(SimilarContactDto.class);
    GeneratedPropertyContainer generatedContainer = new GeneratedPropertyContainer(container);
    setContainerDataSource(generatedContainer);
    setColumns();
}
Also used : GeneratedPropertyContainer(com.vaadin.v7.data.util.GeneratedPropertyContainer) BeanItemContainer(com.vaadin.v7.data.util.BeanItemContainer) SimilarContactDto(de.symeda.sormas.api.contact.SimilarContactDto)

Example 5 with GeneratedPropertyContainer

use of com.vaadin.v7.data.util.GeneratedPropertyContainer in project SORMAS-Project by hzi-braunschweig.

the class PathogenTestSelectionGrid method buildGrid.

private void buildGrid() {
    setSizeFull();
    setSelectionMode(SelectionMode.SINGLE);
    setHeightMode(HeightMode.ROW);
    BeanItemContainer<PathogenTestDto> container = new BeanItemContainer<>(PathogenTestDto.class);
    GeneratedPropertyContainer generatedContainer = new GeneratedPropertyContainer(container);
    setContainerDataSource(generatedContainer);
    setColumns(PathogenTestDto.UUID, PathogenTestDto.TEST_DATE_TIME, PathogenTestDto.TESTED_DISEASE, PathogenTestDto.TEST_TYPE, PathogenTestDto.LAB, PathogenTestDto.TEST_RESULT);
    getColumn(PathogenTestDto.UUID).setRenderer(new V7UuidRenderer());
    getColumn(PathogenTestDto.TEST_DATE_TIME).setRenderer(new DateRenderer(DateHelper.getLocalDateTimeFormat(I18nProperties.getUserLanguage())));
    for (Column column : getColumns()) {
        column.setHeaderCaption(I18nProperties.getPrefixCaption(PathogenTestDto.I18N_PREFIX, column.getPropertyId().toString()));
    }
}
Also used : GeneratedPropertyContainer(com.vaadin.v7.data.util.GeneratedPropertyContainer) BeanItemContainer(com.vaadin.v7.data.util.BeanItemContainer) DateRenderer(com.vaadin.v7.ui.renderers.DateRenderer) PathogenTestDto(de.symeda.sormas.api.sample.PathogenTestDto) V7UuidRenderer(de.symeda.sormas.ui.utils.V7UuidRenderer)

Aggregations

BeanItemContainer (com.vaadin.v7.data.util.BeanItemContainer)6 GeneratedPropertyContainer (com.vaadin.v7.data.util.GeneratedPropertyContainer)6 DateRenderer (com.vaadin.v7.ui.renderers.DateRenderer)3 V7UuidRenderer (de.symeda.sormas.ui.utils.V7UuidRenderer)3 CaseSelectionDto (de.symeda.sormas.api.caze.CaseSelectionDto)1 SimilarContactDto (de.symeda.sormas.api.contact.SimilarContactDto)1 SimilarEventParticipantDto (de.symeda.sormas.api.event.SimilarEventParticipantDto)1 SimilarPersonDto (de.symeda.sormas.api.person.SimilarPersonDto)1 PathogenTestDto (de.symeda.sormas.api.sample.PathogenTestDto)1 SampleDto (de.symeda.sormas.api.sample.SampleDto)1 AgeAndBirthDateDtoConverterV7 (de.symeda.sormas.ui.utils.AgeAndBirthDateDtoConverterV7)1