From: Andreas Müller Date: Tue, 23 Jan 2024 11:43:45 +0000 (+0100) Subject: cleanup X-Git-Tag: 5.42.0^2~19 X-Git-Url: https://dev.e-taxonomy.eu/gitweb/cdm-vaadin.git/commitdiff_plain/1fe9d55a1af7c634f032ca1e7b603779c5564552 cleanup --- diff --git a/src/main/java/eu/etaxonomy/cdm/service/CdmFilterablePagingProvider.java b/src/main/java/eu/etaxonomy/cdm/service/CdmFilterablePagingProvider.java index daf6158b..3466000c 100644 --- a/src/main/java/eu/etaxonomy/cdm/service/CdmFilterablePagingProvider.java +++ b/src/main/java/eu/etaxonomy/cdm/service/CdmFilterablePagingProvider.java @@ -30,7 +30,8 @@ import eu.etaxonomy.cdm.persistence.query.OrderHint; * @author a.kohlbecker * @since Jun 7, 2017 */ -public class CdmFilterablePagingProvider implements FilterablePagingProvider, FilterableCountProvider { +public class CdmFilterablePagingProvider + implements FilterablePagingProvider, FilterableCountProvider { private static final Logger logger = LogManager.getLogger(); @@ -191,9 +192,6 @@ public class CdmFilterablePagingProvider> prepareRestrictions(String filter, MatchMode matchMode) { List> prepared = new ArrayList<>(restrictions.size()); for(Restriction r : restrictions) { @@ -211,39 +209,24 @@ public class CdmFilterablePagingProvider getInitStrategy() { return initStrategy; } - /** - * @param initStrategy the initStrategy to set - */ public void setInitStrategy(List initStrategy) { this.initStrategy = initStrategy; } @@ -283,4 +266,4 @@ public class CdmFilterablePagingProvider restriction){ restrictions.add(restriction); } -} +} \ No newline at end of file diff --git a/src/main/java/eu/etaxonomy/cdm/vaadin/component/registration/RegistrationItem.java b/src/main/java/eu/etaxonomy/cdm/vaadin/component/registration/RegistrationItem.java index 89431928..ef385517 100644 --- a/src/main/java/eu/etaxonomy/cdm/vaadin/component/registration/RegistrationItem.java +++ b/src/main/java/eu/etaxonomy/cdm/vaadin/component/registration/RegistrationItem.java @@ -61,7 +61,6 @@ import eu.etaxonomy.vaadin.ui.navigation.NavigationEvent; /** * @author a.kohlbecker * @since Mar 17, 2017 - * */ public class RegistrationItem extends GridLayout { @@ -104,9 +103,6 @@ public class RegistrationItem extends GridLayout { private ICdmEntityUuidCacher cache; - /** - * - */ public RegistrationItem(RegistrationDTO item, AbstractView parentView, ICdmEntityUuidCacher cache) { super(GRID_COLS, GRID_ROWS); this.cache = cache; @@ -114,16 +110,13 @@ public class RegistrationItem extends GridLayout { setItem(item, parentView); } - /** - * - */ - public RegistrationItem(RegistrationWorkingSet workingSet, AbstractView parentView, ICdmEntityUuidCacher cache) { - super(GRID_COLS, GRID_ROWS); - this.cache = cache; - init(); - blockedByButton.setVisible(false); - setWorkingSet(workingSet, parentView); - } + public RegistrationItem(RegistrationWorkingSet workingSet, AbstractView parentView, ICdmEntityUuidCacher cache) { + super(GRID_COLS, GRID_ROWS); + this.cache = cache; + init(); + blockedByButton.setVisible(false); + setWorkingSet(workingSet, parentView); + } public void init() { @@ -185,7 +178,6 @@ public class RegistrationItem extends GridLayout { releasedLabel.setVisible(false); addComponent(releasedLabel, 2, 3); setComponentAlignment(releasedLabel, Alignment.BOTTOM_RIGHT); - } public void setItem(RegistrationDTO regDto, AbstractView parentView){ @@ -232,9 +224,6 @@ public class RegistrationItem extends GridLayout { referenceEditorAction, FontAwesome.EDIT, null, submitterName); } - /** - * @return - */ private UserHelper cdmUserHelper() { if(cache != null){ return UserHelperAccess.userHelper().withCache(cache); @@ -243,11 +232,6 @@ public class RegistrationItem extends GridLayout { } } - - /** - * @param submitterUserName TODO - * - */ private void updateUI(String citationString, DateTime created, TimePeriod datePublished, int validationProblemsCount, Object openButtonEvent, Resource openButtonIcon, RegistrationDTO regDto, String submitterUserName) { @@ -258,7 +242,7 @@ public class RegistrationItem extends GridLayout { getValidationProblemsButton().setEnabled(true); // getMessageButton().addStyleName(RegistrationStyles.STYLE_FRIENDLY_FOREGROUND); getValidationProblemsButton().addClickListener(e -> { - ShowDetailsEvent detailsEvent; + ShowDetailsEvent detailsEvent; if(regDto != null){ detailsEvent = new ShowDetailsEvent( e, @@ -342,7 +326,6 @@ public class RegistrationItem extends GridLayout { updateDateLabels(created, datePublished, registrationDate); } - private void updateDateLabels(DateTime created, TimePeriod datePublished, DateTime released) { if(created != null){ getCreatedLabel().setValue("" + LABEL_CAPTION_CREATED + " " + created.toString(ISODateTimeFormat.yearMonthDay())); @@ -370,9 +353,6 @@ public class RegistrationItem extends GridLayout { return regDto.getUuid(); } - /** - * @param showBlockingRelations the showBlockingRelations to set - */ public void showBlockingRegistrations(Set blockingRegDTOs) { if(blockingRelationsPanel == null) { @@ -391,85 +371,48 @@ public class RegistrationItem extends GridLayout { } /* ====== RegistrationItemDesign Getters ====== */ - /** - * @return the typeStateLabel - */ + public Label getTypeStateLabel() { return stateLabel; } - /** - * @return the identifierLink - */ public Link getIdentifierLink() { return identifierLink; } - /** - * @return the citationSummaryLabel - */ public Label getCitationSummaryLabel() { return citationSummaryLabel; } - /** - * @return the blockedByButton - */ public Button getBlockedByButton() { return blockedByButton; } - /** - * @return the validationProblemsButton - */ public BadgeButton getValidationProblemsButton() { return validationProblemsButton; } - /** - * @return the openButton - */ public Button getOpenButton() { return openButton; } - /** - * @return the createdLabel - */ public Label getCreatedLabel() { return createdLabel; } - /** - * @return the publishedLabel - */ public Label getPublishedLabel() { return publishedLabel; } - - /** - * @return - */ public Label getReleasedLabel() { return releasedLabel; } - /** - * @return the submitterLabel - */ public Label getSubmitterLabel() { return submitterLabel; } - /** - * @return the showBlockingRelations - */ public boolean isShowBlockingRelations() { return blockingRelationsPanel != null; } - - - /* --------------------------------------- */ - -} +} \ No newline at end of file diff --git a/src/main/java/eu/etaxonomy/cdm/vaadin/event/RegistrationEditorAction.java b/src/main/java/eu/etaxonomy/cdm/vaadin/event/RegistrationEditorAction.java index 8bc611fe..eec5e914 100644 --- a/src/main/java/eu/etaxonomy/cdm/vaadin/event/RegistrationEditorAction.java +++ b/src/main/java/eu/etaxonomy/cdm/vaadin/event/RegistrationEditorAction.java @@ -23,33 +23,15 @@ import eu.etaxonomy.vaadin.mvp.AbstractView; */ public class RegistrationEditorAction extends AbstractEditorAction { - /** - * @param eventType - */ public RegistrationEditorAction(EditorActionType type) { super(type); } - - /** - * @param action - * @param source - */ public RegistrationEditorAction(EditorActionType action, Button source, Field target, AbstractView sourceView) { super(action, source, target, sourceView); } - /** - * @param action - * @param entityId - * @param source - * @param sourceView - */ public RegistrationEditorAction(EditorActionType action, UUID entityUuid, Button source, Field target, AbstractView sourceView) { super(action, entityUuid, source, target, sourceView); } - - - - -} +} \ No newline at end of file diff --git a/src/main/java/eu/etaxonomy/cdm/vaadin/view/registration/RegistrationWorkingsetPresenter.java b/src/main/java/eu/etaxonomy/cdm/vaadin/view/registration/RegistrationWorkingsetPresenter.java index 3ef2c01d..ad153ef0 100644 --- a/src/main/java/eu/etaxonomy/cdm/vaadin/view/registration/RegistrationWorkingsetPresenter.java +++ b/src/main/java/eu/etaxonomy/cdm/vaadin/view/registration/RegistrationWorkingsetPresenter.java @@ -235,8 +235,6 @@ public class RegistrationWorkingsetPresenter select.setNullSelectionAllowed(false); return select; } - - }); loadWorkingSet(getView().getCitationUuid()); @@ -290,7 +288,7 @@ public class RegistrationWorkingsetPresenter if(value != null && value instanceof RegistrationStatus){ if(!Objects.equals(value, reg.getStatus())){ reg.updateStatusAndDate((RegistrationStatus)value); - cdmStore.saveBean(reg, (AbstractView)getView()); + cdmStore.saveBean(reg, (AbstractView)getView()); refreshView(true); } } else { diff --git a/src/main/java/eu/etaxonomy/cdm/vaadin/view/registration/RegistrationWorkingsetView.java b/src/main/java/eu/etaxonomy/cdm/vaadin/view/registration/RegistrationWorkingsetView.java index cc4562f4..041912c7 100644 --- a/src/main/java/eu/etaxonomy/cdm/vaadin/view/registration/RegistrationWorkingsetView.java +++ b/src/main/java/eu/etaxonomy/cdm/vaadin/view/registration/RegistrationWorkingsetView.java @@ -34,22 +34,6 @@ public interface RegistrationWorkingsetView public static final String ACTION_EDIT = "edit"; - /** - * Open a popup editor for an existing TaxonName if the nameUuid is - * given otherwise a blank editor will open if the nameUuid is null. - * - * @param nameUuid can be null - */ - public void openNameEditor(UUID nameUuid); - - /** - * Open a popup editor for an existing Reference if the referenceUuid is - * given otherwise a blank editor will open if the referenceUuid is null. - * - * @param referenceUuid can be null - */ - public void openReferenceEditor(UUID referenceUuid); - public void setSubheaderText(String subheaderText); public void setHeaderText(String subheaderText); diff --git a/src/main/java/eu/etaxonomy/cdm/vaadin/view/registration/RegistrationWorksetViewBean.java b/src/main/java/eu/etaxonomy/cdm/vaadin/view/registration/RegistrationWorksetViewBean.java index cdd4ca41..e468b91f 100644 --- a/src/main/java/eu/etaxonomy/cdm/vaadin/view/registration/RegistrationWorksetViewBean.java +++ b/src/main/java/eu/etaxonomy/cdm/vaadin/view/registration/RegistrationWorksetViewBean.java @@ -10,7 +10,6 @@ package eu.etaxonomy.cdm.vaadin.view.registration; import static eu.etaxonomy.cdm.vaadin.component.registration.RegistrationStyles.LABEL_NOWRAP; -import java.util.ArrayList; import java.util.Collection; import java.util.Collections; import java.util.EnumSet; @@ -102,8 +101,6 @@ public class RegistrationWorksetViewBean public static final String NAME = "workingset"; - private List registrations = new ArrayList<>(); - private String headerText = "Registration Workingset Editor"; private String subheaderText = ""; @@ -509,16 +506,6 @@ public class RegistrationWorksetViewBean )); } - @Override - public void openReferenceEditor(UUID referenceUuid) { - // TODO Auto-generated method stub - } - - @Override - public void openNameEditor(UUID nameUuid) { - // TODO Auto-generated method stub - } - @Override protected String getHeaderText() { return headerText; diff --git a/src/main/java/eu/etaxonomy/cdm/vaadin/view/registration/StartRegistrationPresenter.java b/src/main/java/eu/etaxonomy/cdm/vaadin/view/registration/StartRegistrationPresenter.java index 2f1c5814..e257d407 100644 --- a/src/main/java/eu/etaxonomy/cdm/vaadin/view/registration/StartRegistrationPresenter.java +++ b/src/main/java/eu/etaxonomy/cdm/vaadin/view/registration/StartRegistrationPresenter.java @@ -90,7 +90,7 @@ public class StartRegistrationPresenter new ReferenceEllypsisFormatter(ReferenceEllypsisFormatter.LabelType.BIBLIOGRAPHIC), ReferenceEllypsisFormatter.INIT_STRATEGY ); - TypedEntityCaptionGenerator titleCacheGenrator = new TypedEntityCaptionGenerator(); + TypedEntityCaptionGenerator titleCacheGenrator = new TypedEntityCaptionGenerator<>(); // referencePagingProvider.addRestriction(new Restriction("type", Operator.AND_NOT, null, ReferenceType.Section, ReferenceType.Journal, ReferenceType.PrintSeries)); Criterion criterion = Restrictions.not(Restrictions.or(Restrictions.in("type", new ReferenceType[]{ReferenceType.Section, ReferenceType.Journal, ReferenceType.PrintSeries}))); diff --git a/src/main/java/eu/etaxonomy/cdm/vaadin/view/registration/StartRegistrationViewBean.java b/src/main/java/eu/etaxonomy/cdm/vaadin/view/registration/StartRegistrationViewBean.java index 69530e44..8700604c 100644 --- a/src/main/java/eu/etaxonomy/cdm/vaadin/view/registration/StartRegistrationViewBean.java +++ b/src/main/java/eu/etaxonomy/cdm/vaadin/view/registration/StartRegistrationViewBean.java @@ -160,21 +160,21 @@ public class StartRegistrationViewBean continueButton.setEnabled(false); continueButton.addClickListener(e -> { - UUID refUuid = null; - referenceCombobox.commit(); - if(referenceCombobox.getValue() != null){ - refUuid = referenceCombobox.getValue().getUuid(); - } - getViewEventBus().publish(this, - new RegistrationEditorAction(EditorActionType.ADD, - // passing the refId is hack, bit for some reason the presenter is always referring to the wrong view - refUuid, - continueButton, - null, - StartRegistrationViewBean.this) + UUID refUuid = null; + referenceCombobox.commit(); //Note by AM: why is this necessary, the data should be read only + if(referenceCombobox.getValue() != null){ + refUuid = referenceCombobox.getValue().getUuid(); + } + getViewEventBus().publish(this, + new RegistrationEditorAction(EditorActionType.ADD, + // passing the refId is hack, bit for some reason the presenter is always referring to the wrong view + refUuid, + continueButton, + null, + StartRegistrationViewBean.this) ); - } - ); + } + ); vlayout.addComponents(publicationLayout, continueButton); vlayout.setComponentAlignment(publicationLayout, Alignment.TOP_CENTER); @@ -183,17 +183,11 @@ public class StartRegistrationViewBean addContentComponent(vlayout, 1f); } - /** - * {@inheritDoc} - */ @Override public boolean allowAnonymousAccess() { return false; } - /** - * {@inheritDoc} - */ @Override public Collection> allowedGrantedAuthorities() { return null; @@ -209,75 +203,45 @@ public class StartRegistrationViewBean this.accessDeniedMessage = accessDeniedMessage; } - - /** - * {@inheritDoc} - */ @Override protected String getHeaderText() { return "New Registration"; } - /** - * {@inheritDoc} - */ @Override protected String getSubHeaderText() { return SUBHEADER_DEEFAULT; } - /** - * {@inheritDoc} - */ @Override public void enter(ViewChangeEvent event) { - getPresenter().handleViewEntered(); - } // ------- StartRegistrationView interface methods ----- // - /** - * @return the referenceCombobox - */ @Override public LazyComboBox> getReferenceCombobox() { return referenceCombobox; } - /** - * @return the newPublicationButton - */ @Override public Button getNewPublicationButton() { return newPublicationButton; } - /** - * @return the newPublicationButton - */ @Override public Button getRemoveNewPublicationButton() { return removeNewPublicationButton; } - /** - * @return the newPublicationButton - */ @Override public Button getContinueButton() { return continueButton; } - /** - * @return the newPublicationLabel - */ @Override public Label getNewPublicationLabel() { return newPublicationLabel; } - - - -} +} \ No newline at end of file