Project

General

Profile

Revision 0c710462

ID0c710462e5403db49400b0a3e9ec14ac28fa2e2e
Parent 6182e021
Child 62b85f1d

Added by Katja Luther almost 4 years ago

ref #7215: add boolean parameter to getMisappliedName() in editor

View differences:

eu.etaxonomy.taxeditor.editor/src/main/java/eu/etaxonomy/taxeditor/editor/name/e4/container/ContainerFactoryE4.java
78 78
	        TaxonNameEditorE4 taxonNameEditor) {
79 79
		MisappliedGroupE4 group = taxonNameEditor.getMisappliedGroup();
80 80
		Taxon taxon = HibernateProxyHelper.deproxy(taxonNameEditor.getTaxon(), Taxon.class);
81
		if(taxon.getMisappliedNames().isEmpty()){
81
		if(taxon.getMisappliedNames(true).isEmpty()){
82 82
			taxonNameEditor.removeGroup(group);
83 83
			taxonNameEditor.setMisapplicationsGroup(null);
84 84
		}else{
eu.etaxonomy.taxeditor.editor/src/main/java/eu/etaxonomy/taxeditor/editor/name/e4/container/MisappliedGroupE4.java
31 31

  
32 32
	@Override
33 33
	protected void createContainers() {
34
		for(Taxon misapplication : getEditor().getTaxon().getMisappliedNames()){
34
		for(Taxon misapplication : getEditor().getTaxon().getMisappliedNames(true)){
35 35
		    MisapplicationContainerE4 container = new MisapplicationContainerE4(this, misapplication);
36 36
			this.add(container);
37 37
			container.createContent();
......
46 46
	}
47 47

  
48 48
	private boolean redrawNeeded() {
49
		Set<Taxon> misapplications = getEditor().getTaxon().getMisappliedNames();
49
		Set<Taxon> misapplications = getEditor().getTaxon().getMisappliedNames(true);
50 50

  
51 51
		Set<Taxon> presentMisapplication = new HashSet<Taxon>();
52 52

  
eu.etaxonomy.taxeditor.navigation/src/main/java/eu/etaxonomy/taxeditor/navigation/navigator/IterableSynonymyList.java
1 1
/**
2 2
* Copyright (C) 2007 EDIT
3
* European Distributed Institute of Taxonomy 
3
* European Distributed Institute of Taxonomy
4 4
* http://www.e-taxonomy.eu
5
* 
5
*
6 6
* The contents of this file are subject to the Mozilla Public License Version 1.1
7 7
* See LICENSE.TXT at the top of this package for the full license terms.
8 8
*/
......
31 31
 * @version 1.0
32 32
 */
33 33
public class IterableSynonymyList implements Iterable<TaxonBase> {
34
	
34

  
35 35
	private Taxon taxon;
36 36

  
37 37
	/**
......
48 48
	 *
49 49
	 * @return a {@link java.util.Iterator} object.
50 50
	 */
51
	public Iterator<TaxonBase> iterator() {
51
	@Override
52
    public Iterator<TaxonBase> iterator() {
52 53
		return new TaxonIterator(taxon);
53 54
	}
54
	
55

  
55 56
	class TaxonIterator implements Iterator<TaxonBase> {
56 57

  
57 58
		List<TaxonBase> synonymyList;
58 59
		int index = 0;
59
		
60

  
60 61
		public TaxonIterator(Taxon taxon) {
61 62
			synonymyList = new ArrayList<TaxonBase>();
62 63
			HomotypicalGroup homotypicGroup = taxon.getHomotypicGroup();
63
			
64

  
64 65
			if (homotypicGroup != null) {
65 66
				List<Synonym> homotypicSynonyms = taxon.getSynonymsInGroup(homotypicGroup);
66 67
				for (Synonym synonym : homotypicSynonyms) {
......
71 72
					}
72 73
				}
73 74
			}
74
			
75

  
75 76
			List<HomotypicalGroup> heterotypicGroups = taxon.getHeterotypicSynonymyGroups();
76 77
			for (HomotypicalGroup heterotypicGroup : heterotypicGroups) {
77
				
78

  
78 79
				// Make sure this is not the taxon's homotypic group
79 80
				if (!heterotypicGroup.equals(homotypicGroup)) {
80
								
81

  
81 82
					List<Synonym> heterotypicSynonyms = taxon.getSynonymsInGroup(heterotypicGroup);
82 83
					for (Synonym synonym : heterotypicSynonyms) {
83 84

  
......
88 89
					}
89 90
				}
90 91
			}
91
			
92
			Set<Taxon> misappliedNames = taxon.getMisappliedNames();
92

  
93
			Set<Taxon> misappliedNames = taxon.getMisappliedNames(true);
93 94
			for (Taxon misappliedName : misappliedNames) {
94 95
				synonymyList.add(misappliedName);
95 96
			}
96
			
97

  
97 98
		}
98 99

  
99
		public boolean hasNext() {
100
		@Override
101
        public boolean hasNext() {
100 102
			if (synonymyList.size() == index) {
101 103
				return false;
102 104
			}
103 105
			return true;
104 106
		}
105 107

  
106
		public TaxonBase next() {
108
		@Override
109
        public TaxonBase next() {
107 110
			TaxonBase next = synonymyList.get(index);
108 111
			index++;
109 112
			return next;
110 113
		}
111 114

  
112
		public void remove() {}
115
		@Override
116
        public void remove() {}
113 117
	}
114 118
}

Also available in: Unified diff

Add picture from clipboard (Maximum size: 40 MB)