use of de.symeda.sormas.ui.utils.ShowDetailsListener in project SORMAS-Project by hzi-braunschweig.
the class CaseGridDetailed method initColumns.
@SuppressWarnings("unchecked")
@Override
protected void initColumns() {
addColumn(caze -> {
if (caze.getLatestSampleDateTime() != null) {
return DateFormatHelper.formatLocalDateTime(caze.getLatestSampleDateTime()) + " [" + caze.getSampleCount() + "]";
} else {
return null;
}
}).setCaption(I18nProperties.getPrefixCaption(CaseIndexDetailedDto.I18N_PREFIX, CaseIndexDetailedDto.LATEST_SAMPLE_DATE_TIME)).setId(LATEST_SAMPLE_DATE_TIME_AND_SAMPLE_COUNT).setSortable(false).setWidth(150);
super.initColumns();
if (!FacadeProvider.getConfigFacade().isConfiguredCountry(CountryHelper.COUNTRY_CODE_GERMANY)) {
getColumn(CaseIndexDetailedDto.RE_INFECTION).setHidden(true);
}
getColumn(CaseIndexDetailedDto.SEX).setWidth(80);
getColumn(CaseIndexDetailedDto.AGE_AND_BIRTH_DATE).setWidth(100);
getColumn(CaseIndexDetailedDto.POSTAL_CODE).setWidth(100);
getColumn(CaseIndexDetailedDto.CITY).setWidth(150);
getColumn(CaseIndexDetailedDto.STREET).setWidth(150);
getColumn(CaseIndexDetailedDto.HOUSE_NUMBER).setWidth(50);
getColumn(CaseIndexDetailedDto.ADDITIONAL_INFORMATION).setWidth(200);
getColumn(CaseIndexDetailedDto.PHONE).setWidth(100);
getColumn(CaseIndexDetailedDto.EVENT_COUNT).setWidth(80).setSortable(false);
getColumn(CaseIndexDetailedDto.LATEST_EVENT_ID).setWidth(80).setSortable(false);
getColumn(CaseIndexDetailedDto.LATEST_EVENT_STATUS).setWidth(80).setSortable(false);
getColumn(CaseIndexDetailedDto.LATEST_EVENT_TITLE).setWidth(150).setSortable(false);
((Column<CaseIndexDetailedDto, String>) getColumn(CaseIndexDetailedDto.LATEST_EVENT_ID)).setRenderer(new UuidRenderer());
addItemClickListener(new ShowDetailsListener<>(CaseIndexDetailedDto.LATEST_EVENT_ID, c -> ControllerProvider.getEventController().navigateToData(c.getLatestEventId())));
((Column<CaseIndexDetailedDto, AgeAndBirthDateDto>) getColumn(CaseIndexDetailedDto.AGE_AND_BIRTH_DATE)).setRenderer(value -> value == null ? "" : PersonHelper.getAgeAndBirthdateString(value.getAge(), value.getAgeType(), value.getDateOfBirthDD(), value.getDateOfBirthMM(), value.getDateOfBirthYYYY()), new TextRenderer());
((Column<CaseIndexDetailedDto, Date>) getColumn(CaseIndexDetailedDto.SYMPTOM_ONSET_DATE)).setRenderer(new DateRenderer(DateFormatHelper.getDateFormat())).setCaption(I18nProperties.getPrefixCaption(SymptomsDto.I18N_PREFIX, SymptomsDto.ONSET_DATE)).setWidth(80);
}
use of de.symeda.sormas.ui.utils.ShowDetailsListener in project SORMAS-Project by hzi-braunschweig.
the class ContactGridDetailed method initColumns.
@Override
@SuppressWarnings("unchecked")
protected void initColumns() {
super.initColumns();
getColumn(ContactIndexDetailedDto.SEX).setWidth(80);
getColumn(ContactIndexDetailedDto.APPROXIMATE_AGE).setWidth(50);
getColumn(ContactIndexDetailedDto.DISTRICT_NAME).setWidth(150);
getColumn(ContactIndexDetailedDto.POSTAL_CODE).setWidth(100);
getColumn(ContactIndexDetailedDto.CITY).setWidth(150);
getColumn(ContactIndexDetailedDto.STREET).setWidth(150);
getColumn(ContactIndexDetailedDto.HOUSE_NUMBER).setWidth(50);
getColumn(ContactIndexDetailedDto.ADDITIONAL_INFORMATION).setWidth(200);
getColumn(ContactIndexDetailedDto.PHONE).setWidth(100);
((Column<ContactIndexDetailedDto, CaseReferenceDto>) getColumn(ContactIndexDetailedDto.CAZE)).setWidth(150).setRenderer(entry -> entry != null ? entry.getUuid() : null, new UuidRenderer());
getColumn(ContactIndexDetailedDto.REPORTING_USER).setWidth(150);
addItemClickListener(new ShowDetailsListener<>(ContactIndexDetailedDto.CAZE, false, e -> {
CaseReferenceDto caze = e.getCaze();
if (caze != null && caze.getUuid() != null) {
ControllerProvider.getCaseController().navigateToCase(caze.getUuid());
}
}));
getColumn(ContactIndexDetailedDto.LATEST_EVENT_ID).setWidth(80).setSortable(false);
getColumn(ContactIndexDetailedDto.LATEST_EVENT_TITLE).setWidth(150).setSortable(false);
((Column<ContactIndexDetailedDto, String>) getColumn(ContactIndexDetailedDto.LATEST_EVENT_ID)).setRenderer(new UuidRenderer());
addItemClickListener(new ShowDetailsListener<>(ContactIndexDetailedDto.LATEST_EVENT_ID, c -> ControllerProvider.getEventController().navigateToData(c.getLatestEventId())));
}
Aggregations