Revision e30acb09
Added by Katja Luther about 8 years ago
eu.etaxonomy.taxeditor.editor/src/main/java/eu/etaxonomy/taxeditor/editor/name/handler/NameEditorMenuPropertyTester.java | ||
---|---|---|
35 | 35 |
private static final String CONCEPT = "isConceptRelation"; |
36 | 36 |
private static final String EMPTY_NAMES = "hasEmptyNames"; |
37 | 37 |
private static final String ACCEPTED_AND_NO_HOMOTYPIC_SYNONYMS = "isAcceptedAndHasNoHomotypicSynonyms"; |
38 |
private static final String NOT_HOMOTYPIC_SYNONYM_OF_ACCEPTED = "isNotHomotypicSynonymOfAcceptedTaxon"; |
|
39 |
|
|
40 | 38 |
|
41 | 39 |
/** |
42 | 40 |
* <p>Constructor for NameEditorMenuPropertyTester.</p> |
... | ... | |
78 | 76 |
} |
79 | 77 |
else if(ACCEPTED_AND_NO_HOMOTYPIC_SYNONYMS.equals(property)){ |
80 | 78 |
return isAcceptedAndHasNoHomotypicSynonyms(selectedElement); |
81 |
}else if (NOT_HOMOTYPIC_SYNONYM_OF_ACCEPTED.equals(property)){ |
|
82 |
return isNotHomotypicSynonymOfAcceptedTaxon(selectedElement); |
|
83 | 79 |
} |
84 |
|
|
85 | 80 |
} |
86 | 81 |
|
87 | 82 |
return false; |
... | ... | |
95 | 90 |
} |
96 | 91 |
return false; |
97 | 92 |
} |
98 |
|
|
99 |
private boolean isNotHomotypicSynonymOfAcceptedTaxon(Object selectedElement) { |
|
100 |
if (isSynonym(selectedElement)){ |
|
101 |
Synonym synonym = (Synonym) selectedElement; |
|
102 |
for (Taxon taxon:synonym.getAcceptedTaxa()){ |
|
103 |
if (taxon.getHomotypicGroup().equals(synonym.getHomotypicGroup())){ |
|
104 |
return false; |
|
105 |
} |
|
106 |
} |
|
107 |
} |
|
108 |
return true; |
|
109 |
} |
|
110 |
|
|
111 | 93 |
|
112 | 94 |
/** |
113 | 95 |
* @param receiver |
Also available in: Unified diff
revert the commit, which is already in hotfix branch