Revision d7ad25d9
Added by Katja Luther over 2 years ago
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/ui/section/supplemental/AbstractOriginalSourceElement.java | ||
---|---|---|
71 | 71 |
|
72 | 72 |
@Override |
73 | 73 |
public void setEntity(T entity) { |
74 |
selection_reference.setEntity(entity.getCitation()); |
|
75 |
text_referenceDetail.setText(entity.getCitationMicroReference()); |
|
76 |
text_originaleNameString.setText(entity.getOriginalNameString()); |
|
77 |
ICdmTarget cdmSource = entity.getCdmSource(); |
|
78 |
String source = ""; |
|
79 |
if(cdmSource instanceof IdentifiableEntity) { |
|
80 |
source = ((IdentifiableEntity) cdmSource).getTitleCache(); |
|
81 |
} else if(cdmSource instanceof CdmBase) { |
|
82 |
source += CdmUtils.isNotBlank(source)?"\nUUID: ":""; |
|
83 |
source += ((CdmBase) cdmSource).getUuid().toString(); |
|
84 |
} else if(cdmSource!=null){ |
|
85 |
source = cdmSource.toString(); |
|
86 |
} |
|
87 |
text_cdmsource.setText(source); |
|
88 |
externalLinks.setEntity(entity); |
|
74 |
this.entity = entity; |
|
75 |
if (selection_reference != null){ |
|
76 |
selection_reference.setEntity(entity.getCitation()); |
|
77 |
text_referenceDetail.setText(entity.getCitationMicroReference()); |
|
78 |
text_originaleNameString.setText(entity.getOriginalNameString()); |
|
79 |
ICdmTarget cdmSource = entity.getCdmSource(); |
|
80 |
String source = ""; |
|
81 |
if(cdmSource instanceof IdentifiableEntity) { |
|
82 |
source = ((IdentifiableEntity) cdmSource).getTitleCache(); |
|
83 |
} else if(cdmSource instanceof CdmBase) { |
|
84 |
source += CdmUtils.isNotBlank(source)?"\nUUID: ":""; |
|
85 |
source += ((CdmBase) cdmSource).getUuid().toString(); |
|
86 |
} else if(cdmSource!=null){ |
|
87 |
source = cdmSource.toString(); |
|
88 |
} |
|
89 |
text_cdmsource.setText(source); |
|
90 |
externalLinks.setEntity(entity); |
|
91 |
} |
|
89 | 92 |
} |
90 | 93 |
|
91 | 94 |
/** |
... | ... | |
121 | 124 |
text_cdmsource = formFactory.createTextWithLabelElement( |
122 | 125 |
formElement, "CDM Source", null, SWT.NULL); |
123 | 126 |
((Text) text_cdmsource.getMainControl()).setEditable(false); |
127 |
|
|
128 |
if (entity != null){ |
|
129 |
selection_reference.setEntity(entity.getCitation()); |
|
130 |
text_referenceDetail.setText(entity.getCitationMicroReference()); |
|
131 |
text_originaleNameString.setText(entity.getOriginalNameString()); |
|
132 |
ICdmTarget cdmSource = entity.getCdmSource(); |
|
133 |
String source = ""; |
|
134 |
if(cdmSource instanceof IdentifiableEntity) { |
|
135 |
source = ((IdentifiableEntity) cdmSource).getTitleCache(); |
|
136 |
} else if(cdmSource instanceof CdmBase) { |
|
137 |
source += CdmUtils.isNotBlank(source)?"\nUUID: ":""; |
|
138 |
source += ((CdmBase) cdmSource).getUuid().toString(); |
|
139 |
} else if(cdmSource!=null){ |
|
140 |
source = cdmSource.toString(); |
|
141 |
} |
|
142 |
text_cdmsource.setText(source); |
|
143 |
if (externalLinks != null){ |
|
144 |
externalLinks.setEntity(entity); |
|
145 |
} |
|
146 |
} |
|
124 | 147 |
} |
125 | 148 |
} |
Also available in: Unified diff
ref #9838: change order of ui element creation and setting entity in collection elements