13 |
13 |
import java.util.Arrays;
|
14 |
14 |
|
15 |
15 |
import eu.etaxonomy.cdm.model.agent.TeamOrPersonBase;
|
|
16 |
import eu.etaxonomy.cdm.model.name.NomenclaturalCode;
|
16 |
17 |
import eu.etaxonomy.cdm.model.name.NonViralName;
|
|
18 |
import eu.etaxonomy.cdm.model.name.ZoologicalName;
|
17 |
19 |
import eu.etaxonomy.taxeditor.preference.IPreferenceKeys;
|
18 |
20 |
import eu.etaxonomy.taxeditor.preference.PreferencesUtil;
|
19 |
21 |
import eu.etaxonomy.taxeditor.ui.element.CdmFormFactory;
|
20 |
22 |
import eu.etaxonomy.taxeditor.ui.element.CdmPropertyChangeEvent;
|
21 |
23 |
import eu.etaxonomy.taxeditor.ui.element.ICdmFormElement;
|
|
24 |
import eu.etaxonomy.taxeditor.ui.element.NumberWithLabelElement;
|
22 |
25 |
import eu.etaxonomy.taxeditor.ui.section.AbstractIdentifiableEntityDetailElement;
|
23 |
26 |
import eu.etaxonomy.taxeditor.ui.selection.EntitySelectionElement;
|
24 |
27 |
|
... | ... | |
38 |
41 |
private EntitySelectionElement<TeamOrPersonBase> selectionBasionymAuthor;
|
39 |
42 |
private EntitySelectionElement<TeamOrPersonBase> selectionExCombinationAuthor;
|
40 |
43 |
private EntitySelectionElement<TeamOrPersonBase> selectionCombinationAuthor;
|
|
44 |
|
|
45 |
private NumberWithLabelElement text_publicationYear;
|
|
46 |
private NumberWithLabelElement text_originalPublicationYear;
|
41 |
47 |
/**
|
42 |
48 |
* <p>
|
43 |
49 |
* Constructor for AuthorshipDetailElement.
|
... | ... | |
70 |
76 |
toggleable_cache.setVisible(false);
|
71 |
77 |
}
|
72 |
78 |
}
|
|
79 |
NomenclaturalCode code = entity.getNomenclaturalCode();
|
73 |
80 |
|
74 |
|
selectionCombinationAuthor = formFactory.createSelectionElementWithAbbreviatedTitle(TeamOrPersonBase.class,
|
|
81 |
selectionCombinationAuthor = formFactory.createSelectionElementWithAbbreviatedTitle(TeamOrPersonBase.class,
|
75 |
82 |
getConversationHolder(),
|
76 |
83 |
formElement, "Author",
|
77 |
84 |
entity.getCombinationAuthorship(),
|
... | ... | |
83 |
90 |
entity.getExCombinationAuthorship(),
|
84 |
91 |
EntitySelectionElement.ALL, style);
|
85 |
92 |
addElement(selectionExCombinationAuthor);
|
|
93 |
if (code != null){
|
|
94 |
if (code.equals(NomenclaturalCode.ICZN)){
|
|
95 |
text_publicationYear = formFactory.createNumberTextWithLabelElement(formElement, "Publication Year", ((ZoologicalName)entity).getPublicationYear(), style);
|
|
96 |
|
|
97 |
}
|
|
98 |
}
|
86 |
99 |
selectionBasionymAuthor = formFactory.createSelectionElementWithAbbreviatedTitle(TeamOrPersonBase.class, getConversationHolder(),
|
87 |
100 |
formElement, "Basionym Author", entity.getBasionymAuthorship(),
|
88 |
101 |
EntitySelectionElement.ALL, style);
|
... | ... | |
92 |
105 |
EntitySelectionElement.ALL, style);
|
93 |
106 |
|
94 |
107 |
addElement(selectionExBasionymAuthor);
|
|
108 |
if (code != null){
|
|
109 |
if (code.equals(NomenclaturalCode.ICZN)){
|
|
110 |
|
|
111 |
text_originalPublicationYear = formFactory.createNumberTextWithLabelElement(formElement, "Orig. Publication Year", ((ZoologicalName)entity).getOriginalPublicationYear(), style);
|
|
112 |
|
|
113 |
}
|
|
114 |
}
|
|
115 |
|
|
116 |
|
|
117 |
|
95 |
118 |
}
|
96 |
119 |
|
97 |
120 |
/** {@inheritDoc} */
|
... | ... | |
137 |
160 |
} else if (eventSource == selectionExBasionymAuthor) {
|
138 |
161 |
getEntity().setExBasionymAuthorship(
|
139 |
162 |
selectionExBasionymAuthor.getSelection());
|
140 |
|
}
|
|
163 |
} else if (eventSource == text_originalPublicationYear) {
|
|
164 |
((ZoologicalName)getEntity()).setOriginalPublicationYear(text_originalPublicationYear.getInteger());
|
|
165 |
} else if (eventSource == text_publicationYear) {
|
|
166 |
((ZoologicalName)getEntity()).setPublicationYear(text_publicationYear.getInteger());
|
|
167 |
}
|
141 |
168 |
|
142 |
169 |
// if (eventSource != toggleable_cache) {
|
143 |
170 |
// toggleable_cache.setText(getEntity().getAuthorshipCache());
|
add original publication year to simple details view