1
|
/**
|
2
|
* Copyright (C) 2020 EDIT
|
3
|
* European Distributed Institute of Taxonomy
|
4
|
* http://www.e-taxonomy.eu
|
5
|
*
|
6
|
* The contents of this file are subject to the Mozilla Public License Version 1.1
|
7
|
* See LICENSE.TXT at the top of this package for the full license terms.
|
8
|
*/
|
9
|
package eu.etaxonomy.taxeditor.ui.section.reference;
|
10
|
|
11
|
import org.eclipse.jface.viewers.ISelectionProvider;
|
12
|
|
13
|
import eu.etaxonomy.cdm.api.conversation.ConversationHolder;
|
14
|
import eu.etaxonomy.cdm.model.common.CdmBase;
|
15
|
import eu.etaxonomy.cdm.model.common.SingleSourcedEntityBase;
|
16
|
import eu.etaxonomy.cdm.model.description.DescriptionElementSource;
|
17
|
import eu.etaxonomy.cdm.model.reference.Reference;
|
18
|
import eu.etaxonomy.taxeditor.ui.element.CdmFormFactory;
|
19
|
import eu.etaxonomy.taxeditor.ui.element.ICdmFormElement;
|
20
|
import eu.etaxonomy.taxeditor.ui.section.AbstractCdmDetailElement;
|
21
|
import eu.etaxonomy.taxeditor.ui.section.AbstractCdmDetailSection;
|
22
|
|
23
|
/**
|
24
|
* @author k.luther
|
25
|
* @since Jul 2, 2020
|
26
|
*/
|
27
|
public class SingleSourceSection extends AbstractCdmDetailSection<DescriptionElementSource> {
|
28
|
|
29
|
private CdmBase cdmEntity;
|
30
|
|
31
|
public SingleSourceSection(CdmFormFactory formFactory, ConversationHolder conversation,
|
32
|
ICdmFormElement parentElement, CdmBase cdmEntity, ISelectionProvider selectionProvider, int style) {
|
33
|
super(formFactory, conversation, parentElement, selectionProvider, style);
|
34
|
this.cdmEntity = cdmEntity;
|
35
|
((OriginalSourceElement)this.detailElement).setCdmEntity(cdmEntity);
|
36
|
}
|
37
|
|
38
|
@Override
|
39
|
protected AbstractCdmDetailElement<DescriptionElementSource> createCdmDetailElement(
|
40
|
AbstractCdmDetailSection<DescriptionElementSource> parentElement, int style) {
|
41
|
|
42
|
return new OriginalSourceElement(getFormFactory(), parentElement, cdmEntity);
|
43
|
}
|
44
|
|
45
|
@Override
|
46
|
public String getHeading() {
|
47
|
return "";
|
48
|
}
|
49
|
|
50
|
public Reference getRef() {
|
51
|
return detailElement.getEntity().getCitation();
|
52
|
}
|
53
|
}
|