ref #7010 Adapt poly key handlers for multiple selection
[taxeditor.git] / eu.etaxonomy.taxeditor.navigation / src / main / java / eu / etaxonomy / taxeditor / navigation / navigator / IterableSynonymyList.java
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() {}
        }
 }