ref #7215: add boolean parameter to getMisappliedName() in editor
authorKatja Luther <k.luther@bgbm.org>
Thu, 25 Jan 2018 09:23:39 +0000 (10:23 +0100)
committerKatja Luther <k.luther@bgbm.org>
Thu, 25 Jan 2018 09:23:39 +0000 (10:23 +0100)
eu.etaxonomy.taxeditor.editor/src/main/java/eu/etaxonomy/taxeditor/editor/name/e4/container/ContainerFactoryE4.java
eu.etaxonomy.taxeditor.editor/src/main/java/eu/etaxonomy/taxeditor/editor/name/e4/container/MisappliedGroupE4.java
eu.etaxonomy.taxeditor.navigation/src/main/java/eu/etaxonomy/taxeditor/navigation/navigator/IterableSynonymyList.java

index 0e261332ce64490c29006b59672f7527240cbdf2..492260574ee9081dd5efdecd3fac897d3d00973e 100644 (file)
@@ -78,7 +78,7 @@ public class ContainerFactoryE4 {
                TaxonNameEditorE4 taxonNameEditor) {
                MisappliedGroupE4 group = taxonNameEditor.getMisappliedGroup();
                Taxon taxon = HibernateProxyHelper.deproxy(taxonNameEditor.getTaxon(), Taxon.class);
-               if(taxon.getMisappliedNames().isEmpty()){
+               if(taxon.getMisappliedNames(true).isEmpty()){
                        taxonNameEditor.removeGroup(group);
                        taxonNameEditor.setMisapplicationsGroup(null);
                }else{
index fe9d8c6ab72d28cdd7350ca64f98fb2b268f5995..37a89d74eda8655cb043b06daab5d934b1668013 100644 (file)
@@ -31,7 +31,7 @@ public class MisappliedGroupE4 extends AbstractGroupE4{
 
        @Override
        protected void createContainers() {
-               for(Taxon misapplication : getEditor().getTaxon().getMisappliedNames()){
+               for(Taxon misapplication : getEditor().getTaxon().getMisappliedNames(true)){
                    MisapplicationContainerE4 container = new MisapplicationContainerE4(this, misapplication);
                        this.add(container);
                        container.createContent();
@@ -46,7 +46,7 @@ public class MisappliedGroupE4 extends AbstractGroupE4{
        }
 
        private boolean redrawNeeded() {
-               Set<Taxon> misapplications = getEditor().getTaxon().getMisappliedNames();
+               Set<Taxon> misapplications = getEditor().getTaxon().getMisappliedNames(true);
 
                Set<Taxon> presentMisapplication = new HashSet<Taxon>();
 
index cbd9453e8377a8b8434d017b1d81606eb1ab2be4..1decc989a37dc07ebe60d2c3bb72922d5480cd9c 100644 (file)
@@ -1,8 +1,8 @@
 /**
 * Copyright (C) 2007 EDIT
-* European Distributed Institute of Taxonomy 
+* 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.
 */
@@ -31,7 +31,7 @@ import eu.etaxonomy.cdm.model.taxon.TaxonBase;
  * @version 1.0
  */
 public class IterableSynonymyList implements Iterable<TaxonBase> {
-       
+
        private Taxon taxon;
 
        /**
@@ -48,19 +48,20 @@ public class IterableSynonymyList implements Iterable<TaxonBase> {
         *
         * @return a {@link java.util.Iterator} object.
         */
-       public Iterator<TaxonBase> iterator() {
+       @Override
+    public Iterator<TaxonBase> iterator() {
                return new TaxonIterator(taxon);
        }
-       
+
        class TaxonIterator implements Iterator<TaxonBase> {
 
                List<TaxonBase> synonymyList;
                int index = 0;
-               
+
                public TaxonIterator(Taxon taxon) {
                        synonymyList = new ArrayList<TaxonBase>();
                        HomotypicalGroup homotypicGroup = taxon.getHomotypicGroup();
-                       
+
                        if (homotypicGroup != null) {
                                List<Synonym> homotypicSynonyms = taxon.getSynonymsInGroup(homotypicGroup);
                                for (Synonym synonym : homotypicSynonyms) {
@@ -71,13 +72,13 @@ public class IterableSynonymyList implements Iterable<TaxonBase> {
                                        }
                                }
                        }
-                       
+
                        List<HomotypicalGroup> heterotypicGroups = taxon.getHeterotypicSynonymyGroups();
                        for (HomotypicalGroup heterotypicGroup : heterotypicGroups) {
-                               
+
                                // Make sure this is not the taxon's homotypic group
                                if (!heterotypicGroup.equals(homotypicGroup)) {
-                                                               
+
                                        List<Synonym> heterotypicSynonyms = taxon.getSynonymsInGroup(heterotypicGroup);
                                        for (Synonym synonym : heterotypicSynonyms) {
 
@@ -88,27 +89,30 @@ public class IterableSynonymyList implements Iterable<TaxonBase> {
                                        }
                                }
                        }
-                       
-                       Set<Taxon> misappliedNames = taxon.getMisappliedNames();
+
+                       Set<Taxon> misappliedNames = taxon.getMisappliedNames(true);
                        for (Taxon misappliedName : misappliedNames) {
                                synonymyList.add(misappliedName);
                        }
-                       
+
                }
 
-               public boolean hasNext() {
+               @Override
+        public boolean hasNext() {
                        if (synonymyList.size() == index) {
                                return false;
                        }
                        return true;
                }
 
-               public TaxonBase next() {
+               @Override
+        public TaxonBase next() {
                        TaxonBase next = synonymyList.get(index);
                        index++;
                        return next;
                }
 
-               public void remove() {}
+               @Override
+        public void remove() {}
        }
 }