Search in sources :

Example 1 with BooleanRenderer

use of de.symeda.sormas.ui.utils.BooleanRenderer in project SORMAS-Project by hzi-braunschweig.

the class ShareRequestGrid method initGridColumns.

private void initGridColumns() {
    addShowColumn((request) -> {
        ControllerProvider.getSormasToSormasController().showRequestDetails(request);
    });
    addComponentColumn(indexDto -> createActionButtons(indexDto)).setId(COLUMN_ACTIONS);
    setColumns(SHOW_MESSAGE, SormasToSormasShareRequestIndexDto.UUID, SormasToSormasShareRequestIndexDto.CREATION_DATE, SormasToSormasShareRequestIndexDto.DATA_TYPE, SormasToSormasShareRequestIndexDto.ORGANIZATION_NAME, SormasToSormasShareRequestIndexDto.SENDER_NAME, SormasToSormasShareRequestIndexDto.OWNERSHIP_HANDED_OVER, SormasToSormasShareRequestIndexDto.STATUS, SormasToSormasShareRequestIndexDto.COMMENT, COLUMN_ACTIONS);
    getColumn(COLUMN_ACTIONS).setMinimumWidth(260);
    ((Column<SormasToSormasShareRequestIndexDto, String>) getColumn(LabMessageIndexDto.UUID)).setRenderer(new UuidRenderer());
    ((Column<SormasToSormasShareRequestIndexDto, Date>) getColumn(SormasToSormasShareRequestIndexDto.CREATION_DATE)).setRenderer(new DateRenderer(DateHelper.getLocalDateTimeFormat(I18nProperties.getUserLanguage())));
    getColumn(SormasToSormasShareRequestIndexDto.ORGANIZATION_NAME).setSortable(false);
    getColumn(SormasToSormasShareRequestIndexDto.OWNERSHIP_HANDED_OVER).setRenderer(new BooleanRenderer());
    for (Column<?, ?> column : getColumns()) {
        column.setCaption(I18nProperties.getPrefixCaption(SormasToSormasShareRequestIndexDto.I18N_PREFIX, column.getId(), column.getCaption()));
    }
    setSortOrder(Collections.singletonList(new GridSortOrder<>(getColumn(SormasToSormasShareRequestIndexDto.CREATION_DATE), SortDirection.DESCENDING)));
}
Also used : UuidRenderer(de.symeda.sormas.ui.utils.UuidRenderer) ShareRequestCriteria(de.symeda.sormas.api.sormastosormas.sharerequest.ShareRequestCriteria) Date(java.util.Date) FacadeProvider(de.symeda.sormas.api.FacadeProvider) I18nProperties(de.symeda.sormas.api.i18n.I18nProperties) LabMessageIndexDto(de.symeda.sormas.api.labmessage.LabMessageIndexDto) DateHelper(de.symeda.sormas.api.utils.DateHelper) SortDirection(com.vaadin.shared.data.sort.SortDirection) ControllerProvider(de.symeda.sormas.ui.ControllerProvider) GridSortOrder(com.vaadin.data.provider.GridSortOrder) VaadinIcons(com.vaadin.icons.VaadinIcons) DataProvider(com.vaadin.data.provider.DataProvider) DateRenderer(com.vaadin.ui.renderers.DateRenderer) ButtonHelper(de.symeda.sormas.ui.utils.ButtonHelper) ValoTheme(com.vaadin.ui.themes.ValoTheme) ListDataProvider(com.vaadin.data.provider.ListDataProvider) FilteredGrid(de.symeda.sormas.ui.utils.FilteredGrid) BooleanRenderer(de.symeda.sormas.ui.utils.BooleanRenderer) ShareRequestStatus(de.symeda.sormas.api.sormastosormas.sharerequest.ShareRequestStatus) SortProperty(de.symeda.sormas.api.utils.SortProperty) Collectors(java.util.stream.Collectors) Captions(de.symeda.sormas.api.i18n.Captions) SormasToSormasShareRequestIndexDto(de.symeda.sormas.api.sormastosormas.sharerequest.SormasToSormasShareRequestIndexDto) Consumer(java.util.function.Consumer) ShowDetailsListener(de.symeda.sormas.ui.utils.ShowDetailsListener) HorizontalLayout(com.vaadin.ui.HorizontalLayout) HtmlRenderer(com.vaadin.ui.renderers.HtmlRenderer) Collections(java.util.Collections) Component(com.vaadin.ui.Component) GridSortOrder(com.vaadin.data.provider.GridSortOrder) BooleanRenderer(de.symeda.sormas.ui.utils.BooleanRenderer) UuidRenderer(de.symeda.sormas.ui.utils.UuidRenderer) DateRenderer(com.vaadin.ui.renderers.DateRenderer)

Example 2 with BooleanRenderer

use of de.symeda.sormas.ui.utils.BooleanRenderer in project SORMAS-Project by hzi-braunschweig.

the class TravelEntryGrid method initColumns.

private void initColumns() {
    setColumns(TravelEntryIndexDto.UUID, TravelEntryIndexDto.EXTERNAL_ID, TravelEntryIndexDto.PERSON_FIRST_NAME, TravelEntryIndexDto.PERSON_LAST_NAME, TravelEntryIndexDto.HOME_DISTRICT_NAME, TravelEntryIndexDto.POINT_OF_ENTRY_NAME, TravelEntryIndexDto.RECOVERED, TravelEntryIndexDto.VACCINATED, TravelEntryIndexDto.TESTED_NEGATIVE, TravelEntryIndexDto.QUARANTINE_TO);
    ((Column<TravelEntryIndexDto, String>) getColumn(TravelEntryIndexDto.UUID)).setRenderer(new UuidRenderer());
    ((Column<TravelEntryIndexDto, Boolean>) getColumn(TravelEntryIndexDto.RECOVERED)).setRenderer(new BooleanRenderer());
    ((Column<TravelEntryIndexDto, Boolean>) getColumn(TravelEntryIndexDto.VACCINATED)).setRenderer(new BooleanRenderer());
    ((Column<TravelEntryIndexDto, Boolean>) getColumn(TravelEntryIndexDto.TESTED_NEGATIVE)).setRenderer(new BooleanRenderer());
    ((Column<TravelEntryIndexDto, Date>) getColumn(TravelEntryIndexDto.QUARANTINE_TO)).setRenderer(new DateRenderer(DateFormatHelper.getDateFormat()));
    for (Column<TravelEntryIndexDto, ?> column : getColumns()) {
        column.setCaption(I18nProperties.findPrefixCaptionWithDefault(column.getId(), column.getCaption(), TravelEntryIndexDto.I18N_PREFIX, PersonDto.I18N_PREFIX));
        column.setStyleGenerator(FieldAccessColumnStyleGenerator.getDefault(getBeanType(), column.getId()));
    }
}
Also used : BooleanRenderer(de.symeda.sormas.ui.utils.BooleanRenderer) UuidRenderer(de.symeda.sormas.ui.utils.UuidRenderer) TravelEntryIndexDto(de.symeda.sormas.api.travelentry.TravelEntryIndexDto) DateRenderer(com.vaadin.ui.renderers.DateRenderer)

Aggregations

DateRenderer (com.vaadin.ui.renderers.DateRenderer)2 BooleanRenderer (de.symeda.sormas.ui.utils.BooleanRenderer)2 UuidRenderer (de.symeda.sormas.ui.utils.UuidRenderer)2 DataProvider (com.vaadin.data.provider.DataProvider)1 GridSortOrder (com.vaadin.data.provider.GridSortOrder)1 ListDataProvider (com.vaadin.data.provider.ListDataProvider)1 VaadinIcons (com.vaadin.icons.VaadinIcons)1 SortDirection (com.vaadin.shared.data.sort.SortDirection)1 Component (com.vaadin.ui.Component)1 HorizontalLayout (com.vaadin.ui.HorizontalLayout)1 HtmlRenderer (com.vaadin.ui.renderers.HtmlRenderer)1 ValoTheme (com.vaadin.ui.themes.ValoTheme)1 FacadeProvider (de.symeda.sormas.api.FacadeProvider)1 Captions (de.symeda.sormas.api.i18n.Captions)1 I18nProperties (de.symeda.sormas.api.i18n.I18nProperties)1 LabMessageIndexDto (de.symeda.sormas.api.labmessage.LabMessageIndexDto)1 ShareRequestCriteria (de.symeda.sormas.api.sormastosormas.sharerequest.ShareRequestCriteria)1 ShareRequestStatus (de.symeda.sormas.api.sormastosormas.sharerequest.ShareRequestStatus)1 SormasToSormasShareRequestIndexDto (de.symeda.sormas.api.sormastosormas.sharerequest.SormasToSormasShareRequestIndexDto)1 TravelEntryIndexDto (de.symeda.sormas.api.travelentry.TravelEntryIndexDto)1