use of de.symeda.sormas.ui.utils.UuidRenderer in project SORMAS-Project by hzi-braunschweig.
the class PersonGrid method initColumns.
private void initColumns() {
setColumns(PersonIndexDto.UUID, PersonIndexDto.FIRST_NAME, PersonIndexDto.LAST_NAME, PersonIndexDto.AGE_AND_BIRTH_DATE, PersonIndexDto.SEX, PersonIndexDto.DISTRICT, PersonIndexDto.STREET, PersonIndexDto.HOUSE_NUMBER, PersonIndexDto.POSTAL_CODE, PersonIndexDto.CITY, PersonIndexDto.PHONE, PersonIndexDto.EMAIL_ADDRESS);
((Column<PersonIndexDto, String>) getColumn(PersonIndexDto.UUID)).setRenderer(new UuidRenderer());
((Column<PersonIndexDto, AgeAndBirthDateDto>) getColumn(PersonIndexDto.AGE_AND_BIRTH_DATE)).setRenderer(value -> value == null ? "" : PersonHelper.getAgeAndBirthdateString(value.getAge(), value.getAgeType(), value.getDateOfBirthDD(), value.getDateOfBirthMM(), value.getDateOfBirthYYYY()), new TextRenderer());
for (Column<PersonIndexDto, ?> column : getColumns()) {
column.setCaption(I18nProperties.findPrefixCaptionWithDefault(column.getId(), column.getCaption(), PersonIndexDto.I18N_PREFIX, PersonDto.I18N_PREFIX, LocationDto.I18N_PREFIX));
column.setStyleGenerator(FieldAccessColumnStyleGenerator.getDefault(getBeanType(), column.getId()));
}
}
use of de.symeda.sormas.ui.utils.UuidRenderer in project SORMAS-Project by hzi-braunschweig.
the class ContactsPreviewGrid method buildGrid.
private void buildGrid() {
setSizeFull();
setSelectionMode(Grid.SelectionMode.SINGLE);
setHeightMode(HeightMode.ROW);
Language userLanguage = I18nProperties.getUserLanguage();
removeColumn(SormasToSormasContactPreview.DISEASE);
addComponentColumn(eventPreview -> {
String diseaseText = eventPreview.getDisease().toString();
if (!StringUtils.isEmpty(eventPreview.getDiseaseDetails())) {
diseaseText += " - " + eventPreview.getDiseaseDetails();
}
return new Label(diseaseText);
}).setId(SormasToSormasContactPreview.DISEASE);
List<String> columnConfig = new ArrayList<>();
columnConfig.addAll(Arrays.asList(SormasToSormasContactPreview.UUID, SormasToSormasContactPreview.REPORT_DATE_TIME, SormasToSormasContactPreview.DISEASE, SormasToSormasContactPreview.CONTACT_STATUS, SormasToSormasContactPreview.CONTACT_CLASSIFICATION, SormasToSormasContactPreview.CONTACT_CATEGORY));
columnConfig.addAll(PreviewGridHelper.createPersonColumns(this, SormasToSormasContactPreview::getPerson));
columnConfig.addAll(Arrays.asList(SormasToSormasContactPreview.REGION, SormasToSormasContactPreview.DISTRICT, SormasToSormasContactPreview.COMMUNITY, SormasToSormasContactPreview.LAST_CONTACT_DATE));
setColumns(columnConfig);
((Column<SormasToSormasContactPreview, String>) getColumn(SormasToSormasContactPreview.UUID)).setRenderer(new UuidRenderer());
((Column<SormasToSormasContactPreview, Date>) getColumn(SormasToSormasContactPreview.REPORT_DATE_TIME)).setRenderer(new DateRenderer(DateHelper.getLocalDateTimeFormat(userLanguage)));
((Column<SormasToSormasContactPreview, Date>) getColumn(SormasToSormasContactPreview.LAST_CONTACT_DATE)).setRenderer(new DateRenderer(DateHelper.getLocalDateTimeFormat(userLanguage)));
for (Column<?, ?> column : getColumns()) {
column.setCaption(I18nProperties.findPrefixCaption(column.getId(), SormasToSormasContactPreview.I18N_PREFIX, SormasToSormasPersonPreview.I18N_PREFIX));
}
}
use of de.symeda.sormas.ui.utils.UuidRenderer in project SORMAS-Project by hzi-braunschweig.
the class EventPreviewGrid method buildGrid.
private void buildGrid() {
setSizeFull();
setSelectionMode(SelectionMode.SINGLE);
setHeightMode(HeightMode.ROW);
Language userLanguage = I18nProperties.getUserLanguage();
removeColumn(SormasToSormasEventPreview.DISEASE);
addComponentColumn(casePreview -> {
String diseaseText;
if (casePreview.getDisease() == null) {
diseaseText = "";
} else {
diseaseText = casePreview.getDisease().toString();
if (!StringUtils.isEmpty(casePreview.getDiseaseDetails())) {
diseaseText += " - " + casePreview.getDiseaseDetails();
}
}
return new Label(diseaseText);
}).setId(SormasToSormasEventPreview.DISEASE);
removeColumn(SormasToSormasEventPreview.EVENT_LOCATION);
addComponentColumn(previewData -> new Label(LocationHelper.buildLocationString(previewData.getEventLocation()))).setId(SormasToSormasEventPreview.EVENT_LOCATION);
setColumns(SormasToSormasEventPreview.UUID, SormasToSormasEventPreview.REPORT_DATE_TIME, SormasToSormasEventPreview.EVENT_TITLE, SormasToSormasEventPreview.EVENT_DESC, SormasToSormasEventPreview.DISEASE, SormasToSormasEventPreview.EVENT_LOCATION);
((Column<SormasToSormasEventPreview, String>) getColumn(SormasToSormasEventPreview.UUID)).setRenderer(new UuidRenderer());
((Column<SormasToSormasEventPreview, Date>) getColumn(SormasToSormasEventPreview.REPORT_DATE_TIME)).setRenderer(new DateRenderer(DateHelper.getLocalDateTimeFormat(userLanguage)));
for (Column<?, ?> column : getColumns()) {
column.setCaption(I18nProperties.findPrefixCaption(column.getId(), SormasToSormasEventPreview.I18N_PREFIX, SormasToSormasPersonPreview.I18N_PREFIX));
}
}
use of de.symeda.sormas.ui.utils.UuidRenderer in project SORMAS-Project by hzi-braunschweig.
the class ImmunizationGrid method initColumns.
private void initColumns() {
setColumns(ImmunizationIndexDto.UUID, ImmunizationIndexDto.PERSON_UUID, ImmunizationIndexDto.PERSON_FIRST_NAME, ImmunizationIndexDto.PERSON_LAST_NAME, ImmunizationIndexDto.DISEASE, ImmunizationIndexDto.AGE_AND_BIRTH_DATE, ImmunizationIndexDto.SEX, ImmunizationIndexDto.DISTRICT, ImmunizationIndexDto.MEANS_OF_IMMUNIZATION, ImmunizationIndexDto.MANAGEMENT_STATUS, ImmunizationIndexDto.IMMUNIZATION_STATUS, ImmunizationIndexDto.START_DATE, ImmunizationIndexDto.END_DATE, ImmunizationIndexDto.LAST_VACCINE_TYPE, ImmunizationIndexDto.RECOVERY_DATE);
((Column<ImmunizationIndexDto, String>) getColumn(ImmunizationIndexDto.UUID)).setRenderer(new UuidRenderer());
((Column<ImmunizationIndexDto, String>) getColumn(ImmunizationIndexDto.PERSON_UUID)).setRenderer(new UuidRenderer());
((Column<ImmunizationIndexDto, AgeAndBirthDateDto>) getColumn(ImmunizationIndexDto.AGE_AND_BIRTH_DATE)).setRenderer(value -> value == null ? "" : PersonHelper.getAgeAndBirthdateString(value.getAge(), value.getAgeType(), value.getDateOfBirthDD(), value.getDateOfBirthMM(), value.getDateOfBirthYYYY()), new TextRenderer());
((Column<ImmunizationIndexDto, Date>) getColumn(ImmunizationIndexDto.START_DATE)).setRenderer(new DateRenderer(DateFormatHelper.getDateFormat()));
((Column<ImmunizationIndexDto, Date>) getColumn(ImmunizationIndexDto.END_DATE)).setRenderer(new DateRenderer(DateFormatHelper.getDateFormat()));
((Column<ImmunizationIndexDto, Date>) getColumn(ImmunizationIndexDto.RECOVERY_DATE)).setRenderer(new DateRenderer(DateFormatHelper.getDateFormat()));
for (Column<ImmunizationIndexDto, ?> column : getColumns()) {
column.setCaption(I18nProperties.findPrefixCaptionWithDefault(column.getId(), column.getCaption(), ImmunizationIndexDto.I18N_PREFIX, PersonDto.I18N_PREFIX));
column.setStyleGenerator(FieldAccessColumnStyleGenerator.getDefault(getBeanType(), column.getId()));
}
}
use of de.symeda.sormas.ui.utils.UuidRenderer 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);
((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)));
}
Aggregations