Revision 18457b45
Added by Katja Luther over 4 years ago
eu.etaxonomy.taxeditor.editor/src/main/java/eu/etaxonomy/taxeditor/editor/name/e4/container/ConceptContainerE4.java | ||
---|---|---|
9 | 9 |
|
10 | 10 |
package eu.etaxonomy.taxeditor.editor.name.e4.container; |
11 | 11 |
|
12 |
import java.util.ArrayList; |
|
13 |
import java.util.List; |
|
14 |
|
|
12 |
import org.apache.commons.lang.StringUtils; |
|
15 | 13 |
import org.eclipse.swt.graphics.Font; |
16 | 14 |
|
17 | 15 |
import eu.etaxonomy.cdm.format.taxon.TaxonRelationshipFormatter; |
18 | 16 |
import eu.etaxonomy.cdm.hibernate.HibernateProxyHelper; |
19 |
import eu.etaxonomy.cdm.model.common.Language; |
|
20 | 17 |
import eu.etaxonomy.cdm.model.name.TaxonName; |
21 | 18 |
import eu.etaxonomy.cdm.model.taxon.Taxon; |
22 | 19 |
import eu.etaxonomy.cdm.model.taxon.TaxonRelationship; |
23 |
import eu.etaxonomy.cdm.strategy.cache.TaggedCacheHelper; |
|
24 |
import eu.etaxonomy.cdm.strategy.cache.TaggedText; |
|
25 | 20 |
import eu.etaxonomy.taxeditor.editor.l10n.Messages; |
26 | 21 |
import eu.etaxonomy.taxeditor.editor.name.container.EditorAnnotation; |
27 | 22 |
import eu.etaxonomy.taxeditor.editor.name.e4.TaxonNameEditorE4; |
28 | 23 |
import eu.etaxonomy.taxeditor.model.AbstractUtility; |
29 | 24 |
import eu.etaxonomy.taxeditor.model.NameHelper; |
30 | 25 |
import eu.etaxonomy.taxeditor.preference.Resources; |
31 |
import eu.etaxonomy.taxeditor.store.CdmStore; |
|
32 | 26 |
|
33 | 27 |
/** |
34 | 28 |
* |
... | ... | |
88 | 82 |
String title = ""; |
89 | 83 |
String author = ""; |
90 | 84 |
TaxonName conceptName = HibernateProxyHelper.deproxy(getMisappliedName().getName()); |
91 |
List<Language> languages = new ArrayList<>(); |
|
92 |
languages.add(CdmStore.getDefaultLanguage()); |
|
93 |
List<TaggedText> taggedText = misappliedFormatter.getTaggedText(relationship, true, languages); |
|
94 | 85 |
|
95 |
String title2 = TaggedCacheHelper.createString(taggedText.subList(4, taggedText.size())); |
|
96 |
setNonEditableInfo(title2, false); |
|
86 |
if (isMisapplication && StringUtils.isNotBlank(conceptName.getAuthorshipCache())){ |
|
87 |
author = ", non " + conceptName.getAuthorshipCache(); |
|
88 |
} |
|
89 |
if ((isMisapplication &&getMisappliedName().getSec() == null) || (!isMisapplication && relationship.getCitation() == null)) { |
|
90 |
if (getMisappliedName().getAppendedPhrase() != null ){ |
|
91 |
title = getMisappliedName().getAppendedPhrase(); |
|
92 |
}else if (isMisapplication){ |
|
93 |
title = "auct."; |
|
94 |
|
|
95 |
} |
|
96 |
|
|
97 |
} else { |
|
98 |
String sec ; |
|
99 |
if (isMisapplication){ |
|
100 |
sec = " sensu "; |
|
101 |
}else{ |
|
102 |
sec = " syn. sec. "; |
|
103 |
} |
|
104 |
if (getMisappliedName().getAppendedPhrase() != null ){ |
|
105 |
sec = getMisappliedName().getAppendedPhrase() + " " + sec; |
|
106 |
} |
|
107 |
if (isMisapplication){ |
|
108 |
title += sec + getMisappliedName().getSec().getCacheStrategy().getCitation(getMisappliedName().getSec()); |
|
109 |
}else{ |
|
110 |
title += sec + relationship.getCitation().getCacheStrategy().getCitation(relationship.getCitation()); |
|
111 |
} |
|
112 |
} |
|
113 |
if (relationship.getType().isProParte() && isMisapplication){ |
|
114 |
title += " p.p. "; |
|
115 |
} |
|
116 |
title += author; |
|
117 |
title = title.replace("&", "&&"); |
|
118 |
setNonEditableInfo(title, false); |
|
119 |
|
|
120 |
|
|
121 |
// |
|
122 |
// List<Language> languages = new ArrayList<>(); |
|
123 |
// languages.add(CdmStore.getDefaultLanguage()); |
|
124 |
// List<TaggedText> taggedText = misappliedFormatter.getTaggedText(relationship, true, languages); |
|
125 |
// |
|
126 |
// String title2 = TaggedCacheHelper.createString(taggedText.subList(5, taggedText.size())); |
|
127 |
// |
|
128 |
// |
|
129 |
// setNonEditableInfo(title2, false); |
|
97 | 130 |
} |
98 | 131 |
|
99 | 132 |
public Taxon getMisappliedName() { |
Also available in: Unified diff
revert use of TaxonRelationshipFormatter in NameEditro