cleanup
authorAndreas Müller <a.mueller@bgbm.org>
Tue, 23 Jan 2024 11:43:45 +0000 (12:43 +0100)
committerAndreas Müller <a.mueller@bgbm.org>
Tue, 23 Jan 2024 14:27:17 +0000 (15:27 +0100)
src/main/java/eu/etaxonomy/cdm/service/CdmFilterablePagingProvider.java
src/main/java/eu/etaxonomy/cdm/vaadin/component/registration/RegistrationItem.java
src/main/java/eu/etaxonomy/cdm/vaadin/event/RegistrationEditorAction.java
src/main/java/eu/etaxonomy/cdm/vaadin/view/registration/RegistrationWorkingsetPresenter.java
src/main/java/eu/etaxonomy/cdm/vaadin/view/registration/RegistrationWorkingsetView.java
src/main/java/eu/etaxonomy/cdm/vaadin/view/registration/RegistrationWorksetViewBean.java
src/main/java/eu/etaxonomy/cdm/vaadin/view/registration/StartRegistrationPresenter.java
src/main/java/eu/etaxonomy/cdm/vaadin/view/registration/StartRegistrationViewBean.java

index daf6158b6b010ef442ff1f70f1d532c995ddda28..3466000ce3753b3f2ccd3c64cc07e900c616ea5d 100644 (file)
@@ -30,7 +30,8 @@ import eu.etaxonomy.cdm.persistence.query.OrderHint;
  * @author a.kohlbecker
  * @since Jun 7, 2017
  */
-public class CdmFilterablePagingProvider<T extends IdentifiableEntity, V extends T> implements FilterablePagingProvider<V>, FilterableCountProvider {
+public class CdmFilterablePagingProvider<T extends IdentifiableEntity, V extends T>
+        implements FilterablePagingProvider<V>, FilterableCountProvider {
 
     private static final Logger logger = LogManager.getLogger();
 
@@ -191,9 +192,6 @@ public class CdmFilterablePagingProvider<T extends IdentifiableEntity, V extends
         }
     }
 
-    /**
-     * @return
-     */
     private List<Restriction<?>> prepareRestrictions(String filter, MatchMode matchMode) {
         List<Restriction<?>> prepared = new ArrayList<>(restrictions.size());
         for(Restriction<?> r : restrictions) {
@@ -211,39 +209,24 @@ public class CdmFilterablePagingProvider<T extends IdentifiableEntity, V extends
         return prepared;
     }
 
-    /**
-     *
-     */
     protected void checkNotMixed() {
         if(!restrictions.isEmpty() && !criteria.isEmpty()){
             throw new RuntimeException("Citeria and Restrictions must not be used at the same time");
         }
     }
 
-    /**
-     * @return the pageSize
-     */
     public int getPageSize() {
         return pageSize;
     }
 
-    /**
-     * @param pageSize the pageSize to set
-     */
     public void setPageSize(int pageSize) {
         this.pageSize = pageSize;
     }
 
-    /**
-     * @return the initStrategy
-     */
     public List<String> getInitStrategy() {
         return initStrategy;
     }
 
-    /**
-     * @param initStrategy the initStrategy to set
-     */
     public void setInitStrategy(List<String> initStrategy) {
         this.initStrategy = initStrategy;
     }
@@ -283,4 +266,4 @@ public class CdmFilterablePagingProvider<T extends IdentifiableEntity, V extends
     public void addRestriction(Restriction<?> restriction){
         restrictions.add(restriction);
     }
-}
+}
\ No newline at end of file
index 894319283400044540ec26748b686825d72eb3d3..ef385517857006d935a768b8f8d3b6e59153f6d9 100644 (file)
@@ -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<RegistrationDTO, UUID>(
                             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("<span class=\"caption\">" + LABEL_CAPTION_CREATED + "</span>&nbsp;" + 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<RegistrationDTO> 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
index 8bc611fe2866123bb819f8cf778b8e46f536f919..eec5e914451b43702d6fe106dc9b2ddf745527b9 100644 (file)
@@ -23,33 +23,15 @@ import eu.etaxonomy.vaadin.mvp.AbstractView;
  */
 public class RegistrationEditorAction extends AbstractEditorAction<Registration> {
 
-    /**
-     * @param eventType
-     */
     public RegistrationEditorAction(EditorActionType type) {
         super(type);
     }
 
-
-    /**
-     * @param action
-     * @param source
-     */
     public RegistrationEditorAction(EditorActionType action, Button source, Field<Registration> 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<Registration> target, AbstractView sourceView) {
         super(action, entityUuid, source, target, sourceView);
     }
-
-
-
-
-}
+}
\ No newline at end of file
index 3ef2c01d68c54cde23526ee583a9f14cdef0bc0e..ad153ef08c57b01430e2332c8e42eca345c2bc51 100644 (file)
@@ -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 {
index cc4562f4572dd277e656c07c64df88fec319f6ea..041912c77d761d84d2b8f76ca03fbffcb588e1d7 100644 (file)
@@ -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);
index cdd4ca41cccf8205b094d91d9d67f3bab1d9e831..e468b91f1331aa834576e9695fc6064b29750732 100644 (file)
@@ -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<CssLayout> 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;
index 2f1c581496c32017768b03c3384421d5eb14afc3..e257d40737ec74147c98d947b97dcab08e99910e 100644 (file)
@@ -90,7 +90,7 @@ public class StartRegistrationPresenter
                 new ReferenceEllypsisFormatter(ReferenceEllypsisFormatter.LabelType.BIBLIOGRAPHIC),
                 ReferenceEllypsisFormatter.INIT_STRATEGY
                 );
-        TypedEntityCaptionGenerator<Reference> titleCacheGenrator = new TypedEntityCaptionGenerator<Reference>();
+        TypedEntityCaptionGenerator<Reference> 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})));
 
index 69530e44a1c4d9acd9fb58a779701d853159e29b..8700604c0a778f337efada3b9d20b1cb7cf822c5 100644 (file)
@@ -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<Collection<GrantedAuthority>> 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<TypedEntityReference<Reference>> 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