cleanup
authorAndreas Müller <a.mueller@bgbm.org>
Fri, 19 Mar 2021 15:40:32 +0000 (16:40 +0100)
committerAndreas Müller <a.mueller@bgbm.org>
Fri, 19 Mar 2021 15:40:32 +0000 (16:40 +0100)
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/ui/section/description/DescriptionElementSourceSection.java
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/ui/section/reference/AdvancedSourceElement.java
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/view/e4/details/DetailsViewerE4.java

index 009a127acfbf9ad1ca2f821c29ab56adfacae2fb..a505829838e59db83e2672ca129584d655cc4b10 100644 (file)
@@ -1,6 +1,11 @@
 /**
- *
- */
+* Copyright (C) 2018 EDIT
+* European Distributed Institute of Taxonomy
+* http://www.e-taxonomy.eu
+*
+* The contents of this file are subject to the Mozilla Public License Version 1.1
+* See LICENSE.TXT at the top of this package for the full license terms.
+*/
 package eu.etaxonomy.taxeditor.ui.section.description;
 
 import java.util.Collection;
@@ -18,68 +23,27 @@ import eu.etaxonomy.taxeditor.ui.element.ICdmFormElement;
 import eu.etaxonomy.taxeditor.ui.section.AbstractEntityCollectionSection;
 
 /**
- * <p>
  * DescriptionElementSourceSection class.
- * </p>
  *
  * @author n.hoffmann
  * @created Nov 17, 2009
- * @version 1.0
  */
 public class DescriptionElementSourceSection extends
         AbstractEntityCollectionSection<DescriptionElementBase, OriginalSourceBase> {
 
     private Reference defaultSource;
 
-
-    /**
-     * <p>
-     * Constructor for DescriptionElementSourceSection.
-     * </p>
-     *
-     * @param parentElement
-     *            a {@link eu.etaxonomy.taxeditor.ui.element.ICdmFormElement}
-     *            object.
-     * @param style
-     *            a int.
-     * @param cdmFormFactory
-     *            a {@link eu.etaxonomy.taxeditor.ui.element.CdmFormFactory}
-     *            object.
-     * @param conversation
-     *            a {@link eu.etaxonomy.cdm.api.conversation.ConversationHolder}
-     *            object.
-     */
     public DescriptionElementSourceSection(CdmFormFactory cdmFormFactory, ConversationHolder conversation,
             ICdmFormElement parentElement, int style) {
         super(cdmFormFactory, conversation, parentElement, "Sources", style);
     }
 
-    /**
-     * <p>
-     * Constructor for DescriptionElementSourceSection.
-     * </p>
-     *
-     * @param parentElement
-     *            a {@link eu.etaxonomy.taxeditor.ui.element.ICdmFormElement}
-     *            object.
-     * @param style
-     *            a int.
-     * @param cdmFormFactory
-     *            a {@link eu.etaxonomy.taxeditor.ui.element.CdmFormFactory}
-     *            object.
-     * @param defaultSource
-     *            a default reference for new sources.
-     * @param conversation
-     *            a {@link eu.etaxonomy.cdm.api.conversation.ConversationHolder}
-     *            object.
-     */
     public DescriptionElementSourceSection(CdmFormFactory cdmFormFactory, ConversationHolder conversation,
             ICdmFormElement parentElement, Reference defaultSource, int style) {
         super(cdmFormFactory, conversation, parentElement, "Sources", style);
         this.defaultSource = defaultSource;
     }
 
-    /** {@inheritDoc} */
     @Override
     public DescriptionElementSource createNewElement() {
         DescriptionElementSource source =  DescriptionElementSource.NewInstance(OriginalSourceType.PrimaryTaxonomicSource);
@@ -89,10 +53,9 @@ public class DescriptionElementSourceSection extends
         return source;
     }
 
-    /** {@inheritDoc} */
     @Override
     public Collection<OriginalSourceBase> getCollection(DescriptionElementBase entity) {
-        Collection<OriginalSourceBase> sources = new HashSet();
+        Collection<OriginalSourceBase> sources = new HashSet<>();
         sources.addAll(entity.getSources());
         sources.addAll(entity.getInDescription().getSources());
         return sources;
@@ -100,22 +63,19 @@ public class DescriptionElementSourceSection extends
 
     @Override
     public Comparator<OriginalSourceBase> getComparator() {
-        return new SourceComparator();
+        return new SourceComparator<>();
     }
 
-    /** {@inheritDoc} */
     @Override
     public String getEmptyString() {
         return "No references yet.";
     }
 
-    /** {@inheritDoc} */
     @Override
     protected String getTooltipString() {
         return "Create a new reference";
     }
 
-    /** {@inheritDoc} */
     @Override
     public void addElement(OriginalSourceBase element) {
         if (element instanceof DescriptionElementSource){
@@ -123,7 +83,6 @@ public class DescriptionElementSourceSection extends
         }
     }
 
-    /** {@inheritDoc} */
     @Override
     public void removeElement(OriginalSourceBase element) {
         if (element instanceof DescriptionElementSource){
@@ -131,21 +90,13 @@ public class DescriptionElementSourceSection extends
         }
     }
 
-    /**
-     * {@inheritDoc}
-     */
     @Override
     public DescriptionElementSource addExisting() {
         return null;
     }
 
-    /**
-     * {@inheritDoc}
-     */
     @Override
     public boolean allowAddExisting() {
         return false;
     }
-
-
-}
+}
\ No newline at end of file
index 22431401b0eba07d3485d390bbb0d877ba83ecbe..b38cf4b434904c7b0b1af6e01bc40998375e868a 100755 (executable)
@@ -63,9 +63,7 @@ public class AdvancedSourceElement extends AbstractCdmDetailElement<OriginalSour
         if (PreferencesUtil.getBooleanValue(PreferencePredicate.ShowIdInSource.getKey())){
             text_idInSource = formFactory.createTextWithLabelElement(formElement, "ID in Source", entity != null?entity.getIdInSource():null, style);
             text_idInSource.setBackground(background);
-
         }
-
     }
 
     @Override
@@ -85,4 +83,4 @@ public class AdvancedSourceElement extends AbstractCdmDetailElement<OriginalSour
              ((DescriptionElementSource)getEntity()).setNameUsedInSource(select_nameUsedInSource.getEntity());
          }
     }
-}
+}
\ No newline at end of file
index 3f513c014ec6f38c61d7ac2df7a33a9259cbf056..35c74e8e106ff97bec63b6c4d6123ce4327bd29b 100755 (executable)
@@ -656,7 +656,6 @@ public class DetailsViewerE4 extends AbstractCdmDataViewerE4 {
             descriptionElementSourceSection = formFactory.createDescriptionElementSourceSection(getConversationHolder(), parent, StoreUtil.getSectionStyle(DescriptionElementSourceSection.class, getInput().getClass().getCanonicalName()) );
         }
 
-
         formFactory.createHorizontalSeparator(parent, SWT.BORDER);
 
         DescriptionElementMediaSection descriptionElementMediaSection = formFactory.createDescriptionElementMediaSection(getConversationHolder(), parent, StoreUtil.getSectionStyle(DescriptionElementMediaSection.class, getInput().getClass().getCanonicalName()));