Revision 5d945a6e
Added by Patrick Plitzner over 4 years ago
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/ui/section/supplemental/AbstractOriginalSourceElement.java | ||
---|---|---|
11 | 11 |
|
12 | 12 |
import org.eclipse.swt.SWT; |
13 | 13 |
import org.eclipse.swt.events.SelectionListener; |
14 |
import org.eclipse.swt.widgets.Text; |
|
14 | 15 |
|
16 |
import eu.etaxonomy.cdm.common.CdmUtils; |
|
17 |
import eu.etaxonomy.cdm.model.common.CdmBase; |
|
18 |
import eu.etaxonomy.cdm.model.common.IdentifiableEntity; |
|
15 | 19 |
import eu.etaxonomy.cdm.model.metadata.PreferencePredicate; |
20 |
import eu.etaxonomy.cdm.model.reference.ICdmTarget; |
|
16 | 21 |
import eu.etaxonomy.cdm.model.reference.OriginalSourceBase; |
17 | 22 |
import eu.etaxonomy.cdm.model.reference.OriginalSourceType; |
18 | 23 |
import eu.etaxonomy.taxeditor.preference.PreferencesUtil; |
... | ... | |
34 | 39 |
protected TextWithLabelElement text_idInSource; |
35 | 40 |
protected TextWithLabelElement text_idNamespace; |
36 | 41 |
protected TextWithLabelElement text_originaleNameString; |
42 |
protected TextWithLabelElement text_cdmsource; |
|
37 | 43 |
|
38 | 44 |
protected ExternalLinksSection externalLinks; |
39 | 45 |
|
... | ... | |
58 | 64 |
public void setEntity(T entity) { |
59 | 65 |
super.setEntity(entity); |
60 | 66 |
text_originaleNameString.setText(entity.getOriginalNameString()); |
67 |
ICdmTarget cdmSource = entity.getCdmSource(); |
|
68 |
String source = ""; |
|
69 |
if(cdmSource instanceof IdentifiableEntity) { |
|
70 |
source = ((IdentifiableEntity) cdmSource).getTitleCache(); |
|
71 |
} |
|
72 |
if(cdmSource instanceof CdmBase) { |
|
73 |
source += CdmUtils.isNotBlank(source)?"\nUUID: ":""; |
|
74 |
source += ((CdmBase) cdmSource).getUuid().toString(); |
|
75 |
} |
|
76 |
else if(cdmSource!=null){ |
|
77 |
source = cdmSource.toString(); |
|
78 |
} |
|
79 |
text_cdmsource.setText(source); |
|
61 | 80 |
externalLinks.setEntity(entity); |
62 | 81 |
} |
63 | 82 |
|
... | ... | |
77 | 96 |
} |
78 | 97 |
text_originaleNameString = formFactory.createTextWithLabelElement( |
79 | 98 |
formElement, "Original Information", null, SWT.NULL); |
80 |
|
|
81 |
|
|
99 |
text_cdmsource = formFactory.createTextWithLabelElement( |
|
100 |
formElement, "CDM Source", null, SWT.NULL); |
|
101 |
((Text) text_cdmsource.getMainControl()).setEditable(false); |
|
82 | 102 |
|
83 | 103 |
} |
84 | 104 |
|
Also available in: Unified diff
fix #8688 Make OriginalSourceBase.cdmSource visible in TaxEditor