From f8f20a3ec39f00e61ddf59b3310f24292621fd27 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Andreas=20M=C3=BCller?= Date: Tue, 6 Jun 2023 17:02:00 +0200 Subject: [PATCH] cleanup --- .../model/name/NomenclaturalStatusDTO.java | 16 +++++----------- .../vaadin/view/name/NomenclaturalStatusRow.java | 5 +---- .../view/name/TaxonNameEditorPresenter.java | 7 ++----- 3 files changed, 8 insertions(+), 20 deletions(-) diff --git a/src/main/java/eu/etaxonomy/cdm/vaadin/model/name/NomenclaturalStatusDTO.java b/src/main/java/eu/etaxonomy/cdm/vaadin/model/name/NomenclaturalStatusDTO.java index 3589b6c1..31e0e065 100644 --- a/src/main/java/eu/etaxonomy/cdm/vaadin/model/name/NomenclaturalStatusDTO.java +++ b/src/main/java/eu/etaxonomy/cdm/vaadin/model/name/NomenclaturalStatusDTO.java @@ -27,27 +27,25 @@ public class NomenclaturalStatusDTO implements Serializable { private Integer id = 0; - NomenclaturalStatusType type; + private NomenclaturalStatusType type; - Reference citation; + private String ruleConsidered; - NomenclaturalCodeEdition codeEdition; + private NomenclaturalCodeEdition codeEdition; - String citationMicroReference; + private Reference citation; - String ruleConsidered; + private String citationMicroReference; public static NomenclaturalStatusDTO from(NomenclaturalStatus nomStatus) { return new NomenclaturalStatusDTO(nomStatus.getId(), nomStatus.getType(), nomStatus.getCitation(), nomStatus.getCitationMicroReference(), nomStatus.getRuleConsidered(), nomStatus.getCodeEdition()); - } public static NomenclaturalStatusDTO newInstance() { return new NomenclaturalStatusDTO(); } - /** * Update an existing or create a new {@link NomenclaturalStatus} for this * DTO. @@ -75,7 +73,6 @@ public class NomenclaturalStatusDTO implements Serializable { } nomStatus.setCodeEdition(codeEdition); return nomStatus; - } public NomenclaturalStatusDTO(Integer id, NomenclaturalStatusType type, Reference citation, @@ -88,9 +85,6 @@ public class NomenclaturalStatusDTO implements Serializable { this.codeEdition = codeEdition; } - /** - * - */ public NomenclaturalStatusDTO() { // TODO Auto-generated constructor stub } diff --git a/src/main/java/eu/etaxonomy/cdm/vaadin/view/name/NomenclaturalStatusRow.java b/src/main/java/eu/etaxonomy/cdm/vaadin/view/name/NomenclaturalStatusRow.java index 1e0e7125..5532c861 100644 --- a/src/main/java/eu/etaxonomy/cdm/vaadin/view/name/NomenclaturalStatusRow.java +++ b/src/main/java/eu/etaxonomy/cdm/vaadin/view/name/NomenclaturalStatusRow.java @@ -39,7 +39,7 @@ public class NomenclaturalStatusRow extends CollectionRowItemCollection implemen * The fieldname must match the properties of the SpecimenTypeDesignationDTO */ NativeSelect type = new NativeSelect(); - ToOneRelatedEntityCombobox citation = new ToOneRelatedEntityCombobox(null, Reference.class); + ToOneRelatedEntityCombobox citation = new ToOneRelatedEntityCombobox<>(null, Reference.class); TextField citationMicroReference = new TextFieldNFix(); TextField ruleConsidered = new TextFieldNFix(); NativeSelect codeEdition = new NativeSelect(); @@ -79,9 +79,6 @@ public class NomenclaturalStatusRow extends CollectionRowItemCollection implemen return visibleFields; } - /** - * {@inheritDoc} - */ @Override public void updateRowItemsEnablement() { // nothing to do diff --git a/src/main/java/eu/etaxonomy/cdm/vaadin/view/name/TaxonNameEditorPresenter.java b/src/main/java/eu/etaxonomy/cdm/vaadin/view/name/TaxonNameEditorPresenter.java index 9cd269ab..79407cd7 100644 --- a/src/main/java/eu/etaxonomy/cdm/vaadin/view/name/TaxonNameEditorPresenter.java +++ b/src/main/java/eu/etaxonomy/cdm/vaadin/view/name/TaxonNameEditorPresenter.java @@ -19,8 +19,6 @@ import java.util.Set; import java.util.UUID; import org.apache.commons.lang3.StringUtils; -import org.apache.logging.log4j.LogManager; -import org.apache.logging.log4j.Logger; import org.hibernate.criterion.Restrictions; import org.springframework.context.annotation.Scope; import org.vaadin.spring.events.annotation.EventBusListenerMethod; @@ -101,8 +99,6 @@ public class TaxonNameEditorPresenter private static final long serialVersionUID = -3538980627079389221L; - private static final Logger logger = LogManager.getLogger(); - private static final EnumSet SUB_EDITOR_CRUD = EnumSet.of(CRUD.UPDATE, CRUD.DELETE); private static final List RELATED_NAME_INIT_STRATEGY = Arrays.asList("$", "nomenclaturalSource.annotations", @@ -227,12 +223,13 @@ public class TaxonNameEditorPresenter public NomenclaturalStatusRow create() { NomenclaturalStatusRow row = new NomenclaturalStatusRow(); + //type BeanItemContainer statusTypeItemContainer = cdmBeanItemContainerFactory.buildTermItemContainer( RegistrationTermLists.NOMENCLATURAL_STATUS_TYPE_UUIDS() ); row.type.setContainerDataSource(statusTypeItemContainer); row.type.setItemCaptionMode(ItemCaptionMode.EXPLICIT); - for (DefinedTermBase term : statusTypeItemContainer.getItemIds()) { + for (DefinedTermBase term : statusTypeItemContainer.getItemIds()) { row.type.setItemCaption(term, term.getPreferredRepresentation(Language.DEFAULT()).getAbbreviatedLabel()); } -- 2.34.1