cleanup and remove generics from Identifier class
authorAndreas Müller <a.mueller@bgbm.org>
Thu, 29 Apr 2021 21:16:12 +0000 (23:16 +0200)
committerAndreas Müller <a.mueller@bgbm.org>
Thu, 29 Apr 2021 21:16:12 +0000 (23:16 +0200)
18 files changed:
eu.etaxonomy.taxeditor.editor/src/main/java/eu/etaxonomy/taxeditor/editor/view/media/MediaContentProvider.java
eu.etaxonomy.taxeditor.molecular/src/main/java/eu/etaxonomy/taxeditor/molecular/editor/e4/AlignmentEditorE4.java
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/ui/element/CdmFormFactory.java
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/ui/section/occurrence/AbstractDeterminationEventDetailSection.java
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/ui/section/occurrence/CurrentDeterminationDetailSection.java
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/ui/section/occurrence/DeterminationDetailElement.java
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/ui/section/occurrence/DeterminationDetailSection.java
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/ui/section/occurrence/DeterminationHistoryDetailSection.java
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/ui/section/occurrence/dna/CurrentSampleDesignationDetailSection.java
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/ui/section/occurrence/dna/DnaQualityDetailElement.java
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/ui/section/occurrence/dna/DnaQualityDetailSection.java
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/ui/section/occurrence/dna/DnaSamplePreparationPreservationDetailElement.java
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/ui/section/occurrence/dna/DnaSamplePreparationPreservationSection.java
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/ui/section/occurrence/dna/SampleDesignationDetailSection.java
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/ui/section/occurrence/dna/SampleDesignationHistoryDetailSection.java
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/ui/section/occurrence/dna/TissueSampleGeneralDetailElement.java
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/view/e4/details/DetailsViewerE4.java
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/view/search/derivative/DerivateLabelProvider.java

index 3b0e3c21069994a858f9f52b0f6dbe463304e6ef..f3875df2b12bce7bb3295d18aea0e8caff94e364 100644 (file)
@@ -6,7 +6,6 @@
 * 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.editor.view.media;
 
 import java.util.HashSet;
@@ -52,7 +51,7 @@ public class MediaContentProvider implements ITreeContentProvider{
                                MessagingUtils.error(getClass(), "Taxon is null", null); //$NON-NLS-1$
                                return NO_CHILDREN;
                        }
-                       HashSet<DescriptionBase<?>> imageGalleries = new HashSet<>();
+                       Set<DescriptionBase<?>> imageGalleries = new HashSet<>();
                        for(DescriptionBase<?> description : taxon.getDescriptions()){
                                if(description.isImageGallery()){
                                        imageGalleries.add(description);
index 2678778cc9736c0e6d0c426026b2fb479345fda0..6ff0bc374f80a42871accb1dc203ea7b16b27bf6 100644 (file)
@@ -11,7 +11,6 @@ package eu.etaxonomy.taxeditor.molecular.editor.e4;
 import java.io.File;
 import java.io.IOException;
 import java.io.InputStream;
-
 import java.util.ArrayList;
 import java.util.Collection;
 import java.util.Collections;
@@ -85,8 +84,6 @@ import info.bioinfweb.libralign.pherogram.provider.PherogramProvider;
 import info.bioinfweb.libralign.pherogram.provider.ReverseComplementPherogramProvider;
 import info.bioinfweb.tic.SWTComponentFactory;
 
-
-
 /**
  * Editor component to edit a contig alignment used to combine different overlapping pherograms from Sanger sequencing to
  * a consensus sequence.
@@ -138,8 +135,7 @@ public class AlignmentEditorE4 {
 
 
     private MultipleAlignmentsContainer alignmentsContainer = null;
-    private final Map<String, SingleReadAlignment> cdmMap = new TreeMap<String, SingleReadAlignment>();  //TODO Move this to ContigSequenceDataProvider
-
+    private final Map<String, SingleReadAlignment> cdmMap = new TreeMap<>();  //TODO Move this to ContigSequenceDataProvider
 
     @Inject
     private MDirtyable dirty;
@@ -150,7 +146,6 @@ public class AlignmentEditorE4 {
     public AlignmentEditorE4() {
     }
 
-
     private void refreshToolbarElement(String id) {
                ICommandService commandService =
                                PlatformUI.getWorkbench().getActiveWorkbenchWindow().getService(ICommandService.class);
@@ -159,7 +154,6 @@ public class AlignmentEditorE4 {
                }
     }
 
-
     private void registerEditSettingListener(MultipleAlignmentsContainer container) {
         container.getEditSettings().addListener(new EditSettingsListener() {
             @Override
@@ -179,7 +173,6 @@ public class AlignmentEditorE4 {
         });
     }
 
-
     private AlignmentArea createIndexArea(MultipleAlignmentsContainer container, AlignmentArea labeledArea) {
                AlignmentArea result = new AlignmentArea(container);
                result.setAllowVerticalScrolling(false);
@@ -187,7 +180,6 @@ public class AlignmentEditorE4 {
                return result;
     }
 
-
     private AlignmentArea createEditableAlignmentArea(MultipleAlignmentsContainer container, boolean allowVerticalScrolling) {
                AlignmentArea result = new AlignmentArea(container);
                result.setAllowVerticalScrolling(allowVerticalScrolling);
@@ -201,7 +193,6 @@ public class AlignmentEditorE4 {
                return result;
        }
 
-
     private AlignmentArea createConsensusHintArea(MultipleAlignmentsContainer container,
                AlignmentArea labeledArea) {
 
@@ -212,7 +203,6 @@ public class AlignmentEditorE4 {
                return result;
     }
 
-
     private MultipleAlignmentsContainer getAlignmentsContainer() {
        if (alignmentsContainer == null) {
                alignmentsContainer = new MultipleAlignmentsContainer();
@@ -266,7 +256,6 @@ public class AlignmentEditorE4 {
        }
     }
 
-
     /**
      * Checks whether the specified alignment area or one of its subcomponents currently has the
      * focus.
@@ -280,12 +269,10 @@ public class AlignmentEditorE4 {
        return SWTUtils.childHasFocus((Composite)area.getToolkitComponent());
     }
 
-
     public boolean hasPherogram(String sequenceID) {
         return getReadsArea().getDataAreas().getSequenceAreas(sequenceID).size() > PHEROGRAM_AREA_INDEX;
     }
 
-
     public PherogramArea getPherogramArea(String sequenceID) {
         if (hasPherogram(sequenceID)) {
             return (PherogramArea)getReadsArea().getDataAreas().getSequenceAreas(sequenceID).get(PHEROGRAM_AREA_INDEX);
@@ -295,14 +282,12 @@ public class AlignmentEditorE4 {
         }
     }
 
-
     private ConsensusSequenceArea getConsensusHintDataArea() {
         return (ConsensusSequenceArea)getAlignmentsContainer().getAlignmentAreas().
                 get(CONSENSUS_HINT_AREA_INDEX).getDataAreas().getBottomAreas().
                 get(CONSENSUS_DATA_AREA_INDEX);
     }
 
-
     @Deprecated  //TODO Remove as soon as testing period is over
     private void createTestContents() {
                // Just for testing:
@@ -326,8 +311,7 @@ public class AlignmentEditorE4 {
                }
     }
 
-
-    private void readCDMData(Sequence sequenceNode) {
+    private void readCdmData(Sequence sequenceNode) {
        //TODO If called from somewhere else than createPartControl() the editorInput needs to be checked and previous contents need to be cleared (or updated).
 
                // Add reads:
@@ -358,7 +342,6 @@ public class AlignmentEditorE4 {
                //TODO Can the consensus sequence also be null? / Should it be created here, if nothing is in the DB?
     }
 
-
     @PostConstruct
     public void createPartControl(Composite parent) {
         if (CdmStore.isActive()){
@@ -488,7 +471,7 @@ public class AlignmentEditorE4 {
             if(sequenceNode!=null && sequenceNode.getId()!=0){
                 sequenceNode = CdmStore.getService(ISequenceService.class).load(sequenceNode.getUuid());
             }
-            readCDMData(sequenceNode);
+            readCdmData(sequenceNode);
         }
         else {
             createTestContents();  // This case will removed after the test phase and an exception should probably be thrown.
index ecdae462ccceeae50157d2835a43e5148eeed107..d2ce17e38612d215d58a4729617ceceabcec1d8c 100644 (file)
@@ -104,7 +104,6 @@ import eu.etaxonomy.cdm.model.media.Media;
 import eu.etaxonomy.cdm.model.media.MediaRepresentation;
 import eu.etaxonomy.cdm.model.media.MediaRepresentationPart;
 import eu.etaxonomy.cdm.model.media.Rights;
-import eu.etaxonomy.cdm.model.molecular.DnaSample;
 import eu.etaxonomy.cdm.model.name.NameRelationship;
 import eu.etaxonomy.cdm.model.name.NameRelationshipType;
 import eu.etaxonomy.cdm.model.name.NameTypeDesignation;
@@ -3095,7 +3094,7 @@ public class CdmFormFactory extends FormToolkit {
 //            }
         } else if (entity instanceof Identifier) {
             if(parentElement instanceof AbstractSampleDesignationDetailSection){
-                element = new SampleDesignationTextDetailElement(this, parentElement, (Identifier<DnaSample>) entity, removeListener, backgroundColor, style);
+                element = new SampleDesignationTextDetailElement(this, parentElement, (Identifier) entity, removeListener, backgroundColor, style);
             }
             else{
                 element = new IdentifierElement(this, parentElement, (Identifier) entity, removeListener, style);
index bcee75a263a1ff84a2b26186e093ff9a93c1fbc4..43bebab300ec2c7c6bd7452ef728e7e961018f13 100644 (file)
@@ -22,28 +22,16 @@ import eu.etaxonomy.taxeditor.ui.section.AbstractEntityCollectionSection;
  *
  * @author n.hoffmann
  * @created Oct 13, 2010
- * @version 1.0
  */
 public abstract class AbstractDeterminationEventDetailSection extends
                AbstractEntityCollectionSection<DerivedUnitFacade, DeterminationEvent> {
 
-       /**
-        * @param formFactory
-        * @param conversation
-        * @param parentElement
-        * @param title
-        * @param style
-        */
        public AbstractDeterminationEventDetailSection(CdmFormFactory formFactory,
                        ConversationHolder conversation, ICdmFormElement parentElement,
                        String title, int style) {
                super(formFactory, conversation, parentElement, title, style);
        }
 
-       /* (non-Javadoc)
-        * @see eu.etaxonomy.taxeditor.section.AbstractEntityCollectionSection#createNewElement()
-        */
-       /** {@inheritDoc} */
        @Override
        public DeterminationEvent createNewElement() {
                DeterminationEvent instance = DeterminationEvent.NewInstance();
@@ -56,31 +44,18 @@ public abstract class AbstractDeterminationEventDetailSection extends
                return instance;
        }
 
-       /* (non-Javadoc)
-        * @see eu.etaxonomy.taxeditor.section.AbstractEntityCollectionSection#addElement(eu.etaxonomy.cdm.model.common.IVersionableEntity)
-        */
-       /** {@inheritDoc} */
        @Override
        public void addElement(DeterminationEvent determination) {
                getEntity().addDetermination(determination);
        }
 
-       /* (non-Javadoc)
-        * @see eu.etaxonomy.taxeditor.section.AbstractEntityCollectionSection#removeElement(eu.etaxonomy.cdm.model.common.IVersionableEntity)
-        */
-       /** {@inheritDoc} */
        @Override
        public void removeElement(DeterminationEvent determination) {
                getEntity().removeDetermination(determination);
        }
 
-       /* (non-Javadoc)
-        * @see eu.etaxonomy.taxeditor.section.AbstractEntityCollectionSection#getEmptyString()
-        */
-       /** {@inheritDoc} */
        @Override
        public String getEmptyString() {
                return "No determinations yet.";
        }
-
-}
+}
\ No newline at end of file
index 78d0d6779d8765c2571011fbaa296c95217b0888..1601be4e8aa6e1a98f114127b68a2848b36afeb3 100644 (file)
@@ -6,7 +6,6 @@
 * 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.occurrence;
 
 import java.util.Arrays;
@@ -36,12 +35,6 @@ import eu.etaxonomy.taxeditor.ui.section.DefaultCdmBaseComparator;
 public class CurrentDeterminationDetailSection extends
                AbstractDeterminationEventDetailSection {
 
-       /**
-        * @param formFactory
-        * @param conversation
-        * @param parentElement
-        * @param style
-        */
        public CurrentDeterminationDetailSection(CdmFormFactory formFactory,
                        ConversationHolder conversation, ICdmFormElement parentElement,
                        int style) {
@@ -105,26 +98,18 @@ public class CurrentDeterminationDetailSection extends
                return newElement;
        }
 
-       /** {@inheritDoc} */
        @Override
        protected String getTooltipString() {
                return "Create new current determination event";
        }
 
-    /**
-     * {@inheritDoc}
-     */
     @Override
     public DeterminationEvent addExisting() {
         return null;
     }
 
-    /**
-     * {@inheritDoc}
-     */
     @Override
     public boolean allowAddExisting() {
         return false;
     }
-
-}
+}
\ No newline at end of file
index 048d8502d2b08fc13eeb0451a1d5daa3d2e27602..2f1611894919177f114cd476c9527061e0305102 100644 (file)
@@ -6,7 +6,6 @@
 * 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.occurrence;
 
 import eu.etaxonomy.cdm.api.facade.DerivedUnitFacade;
@@ -19,7 +18,6 @@ import eu.etaxonomy.taxeditor.ui.section.AbstractCdmDetailElement;
 /**
  * @author n.hoffmann
  * @created May 11, 2011
- * @version 1.0
  */
 public class DeterminationDetailElement extends AbstractCdmDetailElement<DerivedUnitFacade> {
 
@@ -27,18 +25,11 @@ public class DeterminationDetailElement extends AbstractCdmDetailElement<Derived
 
        private DeterminationHistoryDetailSection section_determinationHistory;
 
-       /**
-        * @param formFactory
-        * @param formElement
-        */
        public DeterminationDetailElement(CdmFormFactory formFactory,
                        ICdmFormElement formElement) {
                super(formFactory, formElement);
        }
 
-       /* (non-Javadoc)
-        * @see eu.etaxonomy.taxeditor.ui.section.AbstractCdmDetailElement#createControls(eu.etaxonomy.taxeditor.ui.forms.ICdmFormElement, java.lang.Object, int)
-        */
        @Override
        protected void createControls(ICdmFormElement formElement,
                        DerivedUnitFacade entity, int style) {
@@ -53,14 +44,10 @@ public class DeterminationDetailElement extends AbstractCdmDetailElement<Derived
 
        }
 
-       /* (non-Javadoc)
-        * @see eu.etaxonomy.taxeditor.ui.section.AbstractCdmDetailElement#handleEvent(java.lang.Object)
-        */
        @Override
        public void handleEvent(Object eventSource) {
                if(eventSource == section_currentDetermination){
                        section_determinationHistory.refresh();
                }
        }
-
-}
+}
\ No newline at end of file
index 35e59dab898008f315f4a1eca33f79fe8e180dd7..5ac8c110ccf519b28ac9bc183849d12a77816cda 100644 (file)
@@ -6,7 +6,6 @@
 * 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.occurrence;
 
 import org.eclipse.jface.viewers.ISelectionProvider;
@@ -21,41 +20,26 @@ import eu.etaxonomy.taxeditor.ui.section.AbstractCdmDetailSection;
 /**
  * @author n.hoffmann
  * @created May 11, 2011
- * @version 1.0
  */
 public class DeterminationDetailSection extends AbstractCdmDetailSection<DerivedUnitFacade> implements IDerivedUnitFacadeDetailSection {
 
-       /**
-        * @param formFactory
-        * @param conversation
-        * @param parentElement
-        * @param selectionProvider
-        * @param style
-        */
        public DeterminationDetailSection(CdmFormFactory formFactory,
                        ConversationHolder conversation, ICdmFormElement parentElement,
                        ISelectionProvider selectionProvider, int style) {
                super(formFactory, conversation, parentElement, selectionProvider, style);
        }
 
-       /* (non-Javadoc)
-        * @see eu.etaxonomy.taxeditor.ui.section.AbstractCdmDetailSection#getHeading()
-        */
        @Override
        public String getHeading() {
                String sectionTitle = "Determinations";
                if(getEntity()!=null && getEntity().getDeterminations().size()>0){
-                       return sectionTitle+" +"; 
+                       return sectionTitle+" +";
                }
                return sectionTitle;
        }
 
-       /* (non-Javadoc)
-        * @see eu.etaxonomy.taxeditor.ui.section.AbstractCdmDetailSection#createCdmDetailElement(eu.etaxonomy.taxeditor.ui.section.AbstractCdmDetailSection, int)
-        */
        @Override
        protected AbstractCdmDetailElement<DerivedUnitFacade> createCdmDetailElement(AbstractCdmDetailSection<DerivedUnitFacade> parentElement, int style) {
            return formFactory.createDeterminationDetailElement(parentElement);
        }
-
-}
+}
\ No newline at end of file
index f6825e83b464555f5bf342ccea0089d2dd09d88f..fe945fe13c41811e84092f588d1ee3c069c8ce1c 100644 (file)
@@ -6,7 +6,6 @@
 * 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.occurrence;
 
 import java.util.Collection;
@@ -26,12 +25,6 @@ import eu.etaxonomy.taxeditor.ui.section.DefaultCdmBaseComparator;
 public class DeterminationHistoryDetailSection extends
                AbstractDeterminationEventDetailSection {
 
-       /**
-        * @param formFactory
-        * @param conversation
-        * @param parentElement
-        * @param style
-        */
        public DeterminationHistoryDetailSection(CdmFormFactory formFactory,
                        ConversationHolder conversation, ICdmFormElement parentElement,
                        int style) {
@@ -53,26 +46,18 @@ public class DeterminationHistoryDetailSection extends
                internalUpdateSection(false);
        }
 
-       /** {@inheritDoc} */
        @Override
        protected String getTooltipString() {
                return "Add a determination event to the history";
        }
 
-    /**
-     * {@inheritDoc}
-     */
     @Override
     public DeterminationEvent addExisting() {
         return null;
     }
 
-    /**
-     * {@inheritDoc}
-     */
     @Override
     public boolean allowAddExisting() {
         return false;
     }
-
-}
+}
\ No newline at end of file
index ed847e71b8612828a37de28d7a5161acd01a4b8d..c5b7e6b648b02bac1e3c08f281cf18e2f54ddce6 100644 (file)
@@ -6,7 +6,6 @@
 * 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.occurrence.dna;
 
 import java.util.Collection;
@@ -22,10 +21,8 @@ import eu.etaxonomy.taxeditor.ui.section.DefaultCdmBaseComparator;
 import eu.etaxonomy.taxeditor.view.search.derivative.DerivateLabelProvider;
 
 /**
- *
  * @author pplitzner
  * @date Oct 16, 2014
- *
  */
 public class CurrentSampleDesignationDetailSection extends AbstractSampleDesignationDetailSection {
 
@@ -56,13 +53,11 @@ public class CurrentSampleDesignationDetailSection extends AbstractSampleDesigna
         return new DefaultCdmBaseComparator<>();
        }
 
-       /** {@inheritDoc} */
        @Override
        protected String getTooltipString() {
                return "Create new current sample designation";
        }
 
-    /** {@inheritDoc} */
     @Override
     public void addElement(Identifier sampleDesignation) {
         //The current sample designation is always the first one found.
@@ -71,20 +66,13 @@ public class CurrentSampleDesignationDetailSection extends AbstractSampleDesigna
         getEntity().addIdentifier(0, sampleDesignation);
     }
 
-    /**
-     * {@inheritDoc}
-     */
     @Override
     public Identifier addExisting() {
         return null;
     }
 
-    /**
-     * {@inheritDoc}
-     */
     @Override
     public boolean allowAddExisting() {
         return false;
     }
-
-}
+}
\ No newline at end of file
index aa27888c525d650dfd69e509129a98bec99543e7..ef67366319f23a83dd507ad1916a88efe3e2aed3 100644 (file)
@@ -84,7 +84,6 @@ public class DnaQualityDetailElement extends AbstractCdmDetailElement<DerivedUni
         }
         else if(eventSource==dateQualityCheck.getController()){
             DateTime dateTime = dateQualityCheck.getController().getDateTime();
-
             dnaQuality.setQualityCheckDate(dateTime);
         }
     }
index f9c70ca60374148b91f4f92c2c767d0542d4890e..32ede698ccbe9e140f14d4284897a722a0697206 100644 (file)
@@ -20,37 +20,22 @@ import eu.etaxonomy.taxeditor.ui.section.AbstractCdmDetailSection;
 /**
  * @author pplitzner
  * @date 05.03.2014
- *
  */
 public class DnaQualityDetailSection extends AbstractCdmDetailSection<DerivedUnitFacade> {
 
-    /**
-     * @param formFactory
-     * @param conversation
-     * @param parentElement
-     * @param selectionProvider
-     * @param style
-     */
     public DnaQualityDetailSection(CdmFormFactory formFactory,
             ConversationHolder conversation, ICdmFormElement parentElement,
             ISelectionProvider selectionProvider, int style) {
         super(formFactory, conversation, parentElement, selectionProvider, style);
     }
 
-
-    /* (non-Javadoc)
-     * @see eu.etaxonomy.taxeditor.section.AbstractCdmDetailSection#getHeading()
-     */
     @Override
     public String getHeading() {
         return "DNA Quality";
     }
 
-    /* (non-Javadoc)
-     * @see eu.etaxonomy.taxeditor.ui.section.AbstractCdmDetailSection#createCdmDetailElement(eu.etaxonomy.taxeditor.ui.section.AbstractCdmDetailSection, int)
-     */
     @Override
     protected AbstractCdmDetailElement<DerivedUnitFacade> createCdmDetailElement(AbstractCdmDetailSection<DerivedUnitFacade> parentElement, int style) {
         return formFactory.createDnaQualityDetailElement(parentElement);
     }
-}
+}
\ No newline at end of file
index 4bab5d13e8d93ed841d0e3e5d452b11746971116..5832cc4a2bd04432585f8247fe898d3f19d30cae 100644 (file)
@@ -6,7 +6,6 @@
  * 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.occurrence.dna;
 
 import eu.etaxonomy.cdm.api.facade.DerivedUnitFacade;
@@ -26,7 +25,6 @@ import eu.etaxonomy.taxeditor.ui.selection.EntitySelectionElement;
 /**
  * @author pplitzner
  * @date 16.12.2013
- *
  */
 public class DnaSamplePreparationPreservationDetailElement extends AbstractCdmDetailElement<DerivedUnitFacade> {
 
@@ -36,21 +34,10 @@ public class DnaSamplePreparationPreservationDetailElement extends AbstractCdmDe
     private NumberWithLabelElement numberPreservationTemperature;
     private TextWithLabelElement txtMaterialOrMethods;
 
-    /**
-     * @param formFactory
-     * @param formElement
-     */
     public DnaSamplePreparationPreservationDetailElement(CdmFormFactory formFactory, ICdmFormElement formElement) {
         super(formFactory, formElement);
     }
 
-    /*
-     * (non-Javadoc)
-     *
-     * @see
-     * eu.etaxonomy.taxeditor.section.AbstractCdmDetailElement#createControls
-     * (eu.etaxonomy.taxeditor.forms.ICdmFormElement, java.lang.Object, int)
-     */
     @Override
     protected void createControls(ICdmFormElement formElement, DerivedUnitFacade facade, int style) {
         Institution institution = null;
@@ -81,13 +68,6 @@ public class DnaSamplePreparationPreservationDetailElement extends AbstractCdmDe
 
     }
 
-    /*
-     * (non-Javadoc)
-     *
-     * @see
-     * eu.etaxonomy.taxeditor.section.AbstractCdmDetailElement#handleEvent(java
-     * .lang.Object)
-     */
     @Override
     public void handleEvent(Object eventSource) {
         DnaSample entity = (DnaSample)getEntity().innerDerivedUnit();
index bfec88afd07c3e273492b90b76463179547b5ee2..63843c918ed9f59d46537a6fba9348503786df21 100644 (file)
@@ -20,7 +20,6 @@ import eu.etaxonomy.taxeditor.ui.section.AbstractCdmDetailSection;
 /**
  * @author pplitzner
  * @date 12.12.2013
- *
  */
 public class DnaSamplePreparationPreservationSection extends AbstractCdmDetailSection<DerivedUnitFacade> {
 
@@ -30,7 +29,6 @@ public class DnaSamplePreparationPreservationSection extends AbstractCdmDetailSe
         super(formFactory, conversation, parentElement, selectionProvider, style);
     }
 
-
     @Override
     public String getHeading() {
         return "Preparation/Preservation";
@@ -40,4 +38,4 @@ public class DnaSamplePreparationPreservationSection extends AbstractCdmDetailSe
     protected AbstractCdmDetailElement<DerivedUnitFacade> createCdmDetailElement(AbstractCdmDetailSection<DerivedUnitFacade> parentElement, int style) {
         return formFactory.createDnaSamplePreparationPreservationDetailElement(parentElement);
     }
-}
+}
\ No newline at end of file
index da688d76bf2f68f4845114f8c7e424e10a45f575..a4e951b887cc6fe9584e50359107fd2e3bd7171a 100644 (file)
@@ -6,7 +6,6 @@
 * 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.occurrence.dna;
 
 import org.eclipse.jface.viewers.ISelectionProvider;
@@ -21,26 +20,15 @@ import eu.etaxonomy.taxeditor.ui.section.AbstractCdmDetailSection;
 /**
  * @author n.hoffmann
  * @created May 11, 2011
- * @version 1.0
  */
 public class SampleDesignationDetailSection extends AbstractCdmDetailSection<DerivedUnitFacade> {
 
-       /**
-        * @param formFactory
-        * @param conversation
-        * @param parentElement
-        * @param selectionProvider
-        * @param style
-        */
        public SampleDesignationDetailSection(CdmFormFactory formFactory,
                        ConversationHolder conversation, ICdmFormElement parentElement,
                        ISelectionProvider selectionProvider, int style) {
                super(formFactory, conversation, parentElement, selectionProvider, style);
        }
 
-       /* (non-Javadoc)
-        * @see eu.etaxonomy.taxeditor.ui.section.AbstractCdmDetailSection#getHeading()
-        */
        @Override
        public String getHeading() {
                return "Sample Designations";
@@ -52,12 +40,8 @@ public class SampleDesignationDetailSection extends AbstractCdmDetailSection<Der
            setTextClient(createToolbar());
        }
 
-       /* (non-Javadoc)
-        * @see eu.etaxonomy.taxeditor.ui.section.AbstractCdmDetailSection#createCdmDetailElement(eu.etaxonomy.taxeditor.ui.section.AbstractCdmDetailSection, int)
-        */
        @Override
        protected AbstractCdmDetailElement<DerivedUnitFacade> createCdmDetailElement(AbstractCdmDetailSection<DerivedUnitFacade> parentElement, int style) {
            return formFactory.createSampleDesignationDetailElement(parentElement);
        }
-
-}
+}
\ No newline at end of file
index 5cbdc1e375e7776c9b8c35041872daa9e498a170..8c035a6dc4f7215027dc8c661bb2153e1bbd359b 100644 (file)
@@ -6,7 +6,6 @@
 * 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.occurrence.dna;
 
 import java.util.Collection;
@@ -24,25 +23,15 @@ import eu.etaxonomy.taxeditor.view.search.derivative.DerivateLabelProvider;
 /**
  * @author n.hoffmann
  * @created May 11, 2011
- * @version 1.0
  */
 public class SampleDesignationHistoryDetailSection extends AbstractSampleDesignationDetailSection {
 
-       /**
-        * @param formFactory
-        * @param conversation
-        * @param parentElement
-        * @param style
-        */
        public SampleDesignationHistoryDetailSection(CdmFormFactory formFactory,
                        ConversationHolder conversation, ICdmFormElement parentElement,
                        int style) {
                super(formFactory, conversation, parentElement, "Sample Designation History", style);
        }
 
-       /* (non-Javadoc)
-        * @see eu.etaxonomy.taxeditor.ui.section.AbstractEntityCollectionSection#getCollection(java.lang.Object)
-        */
        @Override
        public Collection<Identifier> getCollection(IdentifiableEntity<?> entity) {
            LinkedList<Identifier> sampleDesignations = new LinkedList<>();
@@ -67,20 +56,11 @@ public class SampleDesignationHistoryDetailSection extends AbstractSampleDesigna
                internalUpdateSection(false);
        }
 
-
-       /* (non-Javadoc)
-        * @see eu.etaxonomy.taxeditor.section.AbstractEntityCollectionSection#getTooltipString()
-        */
-       /** {@inheritDoc} */
        @Override
        protected String getTooltipString() {
                return "Add a sample designation to the history";
        }
 
-       /* (non-Javadoc)
-     * @see eu.etaxonomy.taxeditor.section.AbstractEntityCollectionSection#addElement(eu.etaxonomy.cdm.model.common.IVersionableEntity)
-     */
-    /** {@inheritDoc} */
     @Override
     public void addElement(Identifier sampleDesignation) {
         //The current sample designation is always the first one found.
@@ -91,20 +71,13 @@ public class SampleDesignationHistoryDetailSection extends AbstractSampleDesigna
         getEntity().addIdentifier(indexOfCurrentSampleDesignation+1, sampleDesignation);
     }
 
-    /**
-     * {@inheritDoc}
-     */
     @Override
     public Identifier addExisting() {
         return null;
     }
 
-    /**
-     * {@inheritDoc}
-     */
     @Override
     public boolean allowAddExisting() {
         return false;
     }
-
-}
+}
\ No newline at end of file
index a547f24772e1d6da733646418d58dfa55dde5e46..333dd67b588eec99a0ea3dc192a7cd7a07678957 100644 (file)
@@ -74,13 +74,13 @@ public class TissueSampleGeneralDetailElement extends AbstractCdmDetailElement<D
         if(entity.getPreservation()!=null){
             preservationMedium = entity.getPreservation().getMedium();
         }
-        selectionInstitution = formFactory.createSelectionElement(Institution.class, //getConversationHolder(),
+        selectionInstitution = formFactory.createSelectionElement(Institution.class,
                 formElement, "Institution", institution, EntitySelectionElement.ALL, style);
-        selectionStaff = formFactory.createSelectionElement(AgentBase.class, //getConversationHolder(),
+        selectionStaff = formFactory.createSelectionElement(AgentBase.class,
                 formElement, "Staff", staff, EntitySelectionElement.ALL,style);
         datePreparation = formFactory.createTimePeriodElement(formElement, "Preparation date", preparationDate, style);
         comboPreservationMedium = formFactory.createDefinedTermComboElement(TermType.MaterialOrMethod, formElement, "Preservation medium", preservationMedium, style);
-        selectionCollection = formFactory.createSelectionElement(Collection.class, //getConversationHolder(),
+        selectionCollection = formFactory.createSelectionElement(Collection.class,
                 formElement, "Collection", entity.getCollection(), EntitySelectionElement.ALL, style);
         textAccessionNumber = formFactory.createTextWithLabelElement(formElement, "Accession Number", entity.getAccessionNumber(), style);
         textBarcode = formFactory.createTextWithLabelElement(formElement, "Barcode", entity.getBarcode(), style);
index ed367557abb02293ce6d605a2b0ab477c3b8764a..e919b5ea0d7e6be1e1830232c05643e1cdc5dbe5 100755 (executable)
@@ -239,7 +239,7 @@ public class DetailsViewerE4 extends AbstractCdmDataViewerE4 {
         }
         destroySections();
         if (input instanceof TaxonBase) {
-            if(((TaxonBase) input).getName()==null){
+            if(((TaxonBase<?>) input).getName()==null){
                 createEmptySection(Messages.DetailsViewerE4_TAXON_HAS_NO_NAME, rootElement);
             }
             else{
@@ -346,6 +346,7 @@ public class DetailsViewerE4 extends AbstractCdmDataViewerE4 {
             else if(facade.getType()==SpecimenOrObservationType.DnaSample){
 
                 if(facade.innerDerivedUnit().getRecordBasis()==SpecimenOrObservationType.TissueSample){
+                    //this case seems to be very unlikely as innerDerivedUnit has almost always the same type
                     createTissueSampleSection(rootElement);
                 }
                 else if(facade.innerDerivedUnit().getRecordBasis()==SpecimenOrObservationType.DnaSample){
index 6567d827180cf7472e1a0730b899e9e6aaa9c846..9fffed79aefaca3a44a4efa9016742be5b904fac 100644 (file)
@@ -261,8 +261,8 @@ public class DerivateLabelProvider extends ColumnLabelProvider {
         else if(derivate instanceof DnaSample
                 && ((DnaSample) derivate).getRecordBasis()==SpecimenOrObservationType.DnaSample){
             DnaSample dnaSample = (DnaSample)derivate;
-            if(((DnaSample) derivate).getRecordBasis()==SpecimenOrObservationType.DnaSample){
-                Identifier<DnaSample> currentSampleDesignation = getCurrentSampleDesignation(dnaSample);
+            if(dnaSample.getRecordBasis()==SpecimenOrObservationType.DnaSample){
+                Identifier currentSampleDesignation = getCurrentSampleDesignation(dnaSample);
                 if(currentSampleDesignation!=null && currentSampleDesignation.getIdentifier()!=null){
                     label += currentSampleDesignation.getIdentifier()+separator;
                 }
@@ -307,7 +307,7 @@ public class DerivateLabelProvider extends ColumnLabelProvider {
                 if(derivedUnit.getKindOfUnit()!=null){
                     label += derivedUnit.getKindOfUnit()+separator;
                 }
-                Identifier<DnaSample> currentSampleDesignation = getCurrentSampleDesignation(derivedUnit);
+                Identifier currentSampleDesignation = getCurrentSampleDesignation(derivedUnit);
                 if(currentSampleDesignation!=null && currentSampleDesignation.getIdentifier()!=null){
                     label += currentSampleDesignation.getIdentifier() + separator;
                 }
@@ -319,7 +319,7 @@ public class DerivateLabelProvider extends ColumnLabelProvider {
         //Sequence
         else if(derivate instanceof Sequence){
             Sequence sequence = (Sequence)derivate;
-            Identifier<DnaSample> currentSampleDesignation = getCurrentSampleDesignation(sequence);
+            Identifier currentSampleDesignation = getCurrentSampleDesignation(sequence);
             if(currentSampleDesignation!=null && currentSampleDesignation.getIdentifier()!=null){
                 label += currentSampleDesignation.getIdentifier()+separator;
             }
@@ -333,7 +333,7 @@ public class DerivateLabelProvider extends ColumnLabelProvider {
             SingleRead singleRead = (SingleRead)derivate;
             if(parentNode!=null && parentNode.getValue() instanceof Sequence){
                 Sequence sequence = (Sequence) parentNode.getValue();
-                Identifier<DnaSample> currentSampleDesignation = getCurrentSampleDesignation(sequence);
+                Identifier currentSampleDesignation = getCurrentSampleDesignation(sequence);
                 if(currentSampleDesignation!=null && currentSampleDesignation.getIdentifier()!=null){
                     label = currentSampleDesignation.getIdentifier()+separator;
                 }
@@ -434,10 +434,10 @@ public class DerivateLabelProvider extends ColumnLabelProvider {
         return ImageResources.getImage(ImageResources.DEFAULT_DERIVATIVE);
     }
 
-    public static Identifier<DnaSample> getCurrentSampleDesignation(CdmBase entity) {
+    public static Identifier getCurrentSampleDesignation(CdmBase entity) {
         if(entity.isInstanceOf(DnaSample.class)){
             DnaSample dnaSample = HibernateProxyHelper.deproxy(entity, DnaSample.class);
-            for (Identifier<DnaSample> identifier : dnaSample.getIdentifiers()) {
+            for (Identifier identifier : dnaSample.getIdentifiers()) {
                 if(identifier.getType()!=null && identifier.getType().equals(DerivateLabelProvider.getSampleDesignationTerm())){
                     //first sample designation is the current
                     return identifier;