Revision 904cd1c0
Added by Andreas Kohlbecker almost 6 years ago
src/main/java/eu/etaxonomy/cdm/vaadin/view/name/TaxonNameEditorPresenter.java | ||
---|---|---|
130 | 130 |
getView().getReplacedSynonymsComboboxSelect().setCaptionGenerator( new CdmTitleCacheCaptionGenerator<TaxonName>()); |
131 | 131 |
// reusing the basionymPagingProvider for the replaced synonyms to benefit from caching |
132 | 132 |
getView().getReplacedSynonymsComboboxSelect().setPagingProviders(basionymPagingProvider, basionymPagingProvider, basionymPagingProvider.getPageSize(), this); |
133 |
|
|
134 |
getView().getValidationField().getValidatedNameComboBox().getSelect().setCaptionGenerator(new CdmTitleCacheCaptionGenerator<TaxonName>()); |
|
135 |
// reusing the basionymPagingProvider for the replaced synonyms to benefit from caching |
|
136 |
getView().getValidationField().getValidatedNameComboBox().loadFrom(basionymPagingProvider, basionymPagingProvider, basionymPagingProvider.getPageSize()); |
|
137 |
getView().getValidationField().getValidatedNameComboBox().getSelect().addValueChangeListener(new ToOneRelatedEntityReloader<>(getView().getValidationField().getValidatedNameComboBox(), this)); |
|
138 |
|
|
139 |
|
|
140 |
getView().getValidationField().getCitatonComboBox().getSelect().setCaptionGenerator(new CdmTitleCacheCaptionGenerator<Reference>()); |
|
141 |
getView().getValidationField().getCitatonComboBox().loadFrom(referencePagingProvider, referencePagingProvider, referencePagingProvider.getPageSize()); |
|
142 |
getView().getValidationField().getCitatonComboBox().getSelect().addValueChangeListener(new ToOneRelatedEntityReloader<>(getView().getValidationField().getCitatonComboBox(), this)); |
|
143 |
|
|
133 | 144 |
} |
134 | 145 |
|
135 | 146 |
/** |
... | ... | |
331 | 342 |
if(getView() == null || event.getSourceView() != getView() ){ |
332 | 343 |
return; |
333 | 344 |
} |
345 |
ReloadableLazyComboBox<TaxonName> sourceField = (ReloadableLazyComboBox<TaxonName>)event.getSourceComponent(); |
|
334 | 346 |
|
335 |
basionymSourceField = (ReloadableLazyComboBox<TaxonName>)event.getSourceComponent(); |
|
347 |
if(sourceField == getView().getValidationField().getValidatedNameComboBox().getSelect()){ |
|
348 |
// validatedNameSourceField .. this is awkward, better use a map to correlate fields to popup editors!!!! |
|
336 | 349 |
|
337 |
basionymNamePopup = getNavigationManager().showInPopup(TaxonNamePopupEditor.class, getView()); |
|
338 |
basionymNamePopup.grantToCurrentUser(EnumSet.of(CRUD.UPDATE, CRUD.DELETE)); |
|
339 |
basionymNamePopup.withDeleteButton(true); |
|
340 |
getView().getModesActive().stream() |
|
341 |
.filter( |
|
342 |
m -> !TaxonNamePopupEditorMode.NOMENCLATURALREFERENCE_SECTION_EDITING_ONLY.equals(m)) |
|
343 |
.forEach(m -> basionymNamePopup.enableMode(m)); |
|
344 |
basionymNamePopup.loadInEditor(event.getEntityUuid()); |
|
345 |
basionymNamePopup.getBasionymToggle().setVisible(false); |
|
350 |
} else { |
|
351 |
basionymSourceField = sourceField; |
|
352 |
|
|
353 |
basionymNamePopup = getNavigationManager().showInPopup(TaxonNamePopupEditor.class, getView()); |
|
354 |
basionymNamePopup.grantToCurrentUser(EnumSet.of(CRUD.UPDATE, CRUD.DELETE)); |
|
355 |
basionymNamePopup.withDeleteButton(true); |
|
356 |
getView().getModesActive().stream() |
|
357 |
.filter( |
|
358 |
m -> !TaxonNamePopupEditorMode.NOMENCLATURALREFERENCE_SECTION_EDITING_ONLY.equals(m)) |
|
359 |
.forEach(m -> basionymNamePopup.enableMode(m)); |
|
360 |
basionymNamePopup.loadInEditor(event.getEntityUuid()); |
|
361 |
basionymNamePopup.getBasionymToggle().setVisible(false); |
|
362 |
} |
|
346 | 363 |
|
347 | 364 |
} |
348 | 365 |
|
Also available in: Unified diff
ref #7364 validation section implemented in TaxonNameEditor