Revision d74515be
Added by Katja Luther over 3 years ago
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/ui/section/supplemental/AbstractOriginalSourceElement.java | ||
---|---|---|
19 | 19 |
import eu.etaxonomy.cdm.model.reference.ICdmTarget; |
20 | 20 |
import eu.etaxonomy.cdm.model.reference.OriginalSourceBase; |
21 | 21 |
import eu.etaxonomy.cdm.model.reference.OriginalSourceType; |
22 |
import eu.etaxonomy.cdm.model.reference.Reference; |
|
22 | 23 |
import eu.etaxonomy.taxeditor.preference.PreferencesUtil; |
23 | 24 |
import eu.etaxonomy.taxeditor.ui.combo.EnumComboElement; |
24 | 25 |
import eu.etaxonomy.taxeditor.ui.combo.OriginalSourceTypeComparator; |
... | ... | |
27 | 28 |
import eu.etaxonomy.taxeditor.ui.element.ICdmFormElement; |
28 | 29 |
import eu.etaxonomy.taxeditor.ui.element.TextWithLabelElement; |
29 | 30 |
import eu.etaxonomy.taxeditor.ui.section.common.ExternalLinksSection; |
31 |
import eu.etaxonomy.taxeditor.ui.selection.EntitySelectionElement; |
|
30 | 32 |
|
31 | 33 |
/** |
32 | 34 |
* @author n.hoffmann |
33 | 35 |
* @created Mar 16, 2010 |
34 | 36 |
*/ |
35 | 37 |
public abstract class AbstractOriginalSourceElement<T extends OriginalSourceBase> extends AbstractReferencedEntityElement<T> { |
36 |
|
|
38 |
|
|
39 |
|
|
40 |
protected EntitySelectionElement<Reference> selection_reference; |
|
41 |
protected TextWithLabelElement text_referenceDetail; |
|
37 | 42 |
protected EnumComboElement<OriginalSourceType> combo_origsourcetype; |
38 | 43 |
protected TextWithLabelElement text_idInSource; |
39 | 44 |
protected TextWithLabelElement text_idNamespace; |
... | ... | |
58 | 63 |
|
59 | 64 |
@Override |
60 | 65 |
public void setEntity(T entity) { |
61 |
super.setEntity(entity); |
|
66 |
selection_reference.setEntity(entity.getCitation()); |
|
67 |
text_referenceDetail.setText(entity.getCitationMicroReference()); |
|
62 | 68 |
text_originaleNameString.setText(entity.getOriginalNameString()); |
63 | 69 |
ICdmTarget cdmSource = entity.getCdmSource(); |
64 | 70 |
String source = ""; |
... | ... | |
78 | 84 |
* @wbp.parser.entryPoint*/ |
79 | 85 |
@Override |
80 | 86 |
public void createControls(ICdmFormElement formElement, int style) { |
87 |
if (isCommonNameReference && PreferencesUtil.getFilterCommonNameReferences()){ |
|
88 |
selection_reference = formFactory |
|
89 |
.createCommonNameReferenceSelectionElement(formElement, "Reference", |
|
90 |
null, EntitySelectionElement.ALL, style); |
|
91 |
}else{ |
|
92 |
selection_reference = formFactory |
|
93 |
.createSelectionElement(Reference.class,//getConversationHolder(), |
|
94 |
formElement, "Reference", |
|
95 |
null, EntitySelectionElement.ALL, style); |
|
96 |
} |
|
97 |
|
|
98 |
text_referenceDetail = formFactory.createTextWithLabelElement( |
|
99 |
formElement, "Reference Detail", null, SWT.NULL); |
|
100 |
|
|
81 | 101 |
combo_origsourcetype = formFactory |
82 | 102 |
.createEnumComboElement(OriginalSourceType.class, |
83 | 103 |
formElement, new OriginalSourceTypeComparator(getEntity()), style, false); |
Also available in: Unified diff
ref #9199: continue adapt editor to singleSourcedEntities