Revision 69d856ba
Added by Katja Luther almost 10 years ago
- not running imports and exports deleted from menu
- preferences for concept relations fixed
- open taxon editor with one click in taxon navigator
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/store/TermManager.java | ||
---|---|---|
23 | 23 |
import eu.etaxonomy.cdm.model.common.DefinedTermBase; |
24 | 24 |
import eu.etaxonomy.cdm.model.common.TermBase; |
25 | 25 |
import eu.etaxonomy.cdm.model.common.TermType; |
26 |
import eu.etaxonomy.cdm.model.taxon.TaxonRelationshipType; |
|
26 | 27 |
import eu.etaxonomy.taxeditor.model.ContextListenerAdapter; |
28 |
import eu.etaxonomy.taxeditor.model.TaxonRelationshipTypeInverseContainer; |
|
27 | 29 |
|
28 | 30 |
/** |
29 | 31 |
* @author n.hoffmann |
... | ... | |
135 | 137 |
|
136 | 138 |
String typeName = getTermClass(initialTerms); |
137 | 139 |
Collection<UUID> hiddenTermUuids = hiddenTermsMap.get(typeName); |
140 |
|
|
138 | 141 |
|
139 | 142 |
if(hiddenTermUuids == null){ |
140 | 143 |
return initialTerms; |
141 | 144 |
} |
142 | 145 |
|
143 | 146 |
for (T term : initialTerms){ |
147 |
if (term instanceof TaxonRelationshipTypeInverseContainer){ |
|
148 |
if(! hiddenTermUuids.contains(((TaxonRelationshipTypeInverseContainer) term).getType().getUuid())){ |
|
149 |
T type = (T)((TaxonRelationshipTypeInverseContainer) term).getType(); |
|
150 |
filteredTerms.add(type); |
|
151 |
|
|
152 |
} |
|
153 |
} |
|
144 | 154 |
if(! hiddenTermUuids.contains(term.getUuid())){ |
145 | 155 |
filteredTerms.add(term); |
146 | 156 |
} |
... | ... | |
150 | 160 |
} |
151 | 161 |
|
152 | 162 |
private <T extends DefinedTermBase> String getTermClass(Collection<T> initialTerms){ |
153 |
if(!initialTerms.isEmpty()){ |
|
154 |
return initialTerms.iterator().next().getClass().getName(); |
|
163 |
|
|
164 |
String result = null; |
|
165 |
if(!initialTerms.isEmpty()){ |
|
166 |
|
|
167 |
//TODO: there should be a more generic solution!! |
|
168 |
T entity = initialTerms.iterator().next(); |
|
169 |
if (entity instanceof TaxonRelationshipTypeInverseContainer){ |
|
170 |
result = ((TaxonRelationshipTypeInverseContainer) entity).getType().getClass().getName(); |
|
171 |
} else { |
|
172 |
result = entity.getClass().getName(); |
|
173 |
} |
|
174 |
return result; |
|
155 | 175 |
} |
156 | 176 |
return null; |
157 | 177 |
} |
Also available in: Unified diff