1
|
// $Id$
|
2
|
/**
|
3
|
* Copyright (C) 2007 EDIT
|
4
|
* European Distributed Institute of Taxonomy
|
5
|
* http://www.e-taxonomy.eu
|
6
|
*
|
7
|
* The contents of this file are subject to the Mozilla Public License Version 1.1
|
8
|
* See LICENSE.TXT at the top of this package for the full license terms.
|
9
|
*/
|
10
|
|
11
|
package eu.etaxonomy.taxeditor.ui.section.name;
|
12
|
|
13
|
import org.eclipse.jface.viewers.ISelectionProvider;
|
14
|
|
15
|
import eu.etaxonomy.cdm.api.conversation.ConversationHolder;
|
16
|
import eu.etaxonomy.cdm.hibernate.HibernateProxyHelper;
|
17
|
import eu.etaxonomy.cdm.model.name.NonViralName;
|
18
|
import eu.etaxonomy.cdm.model.taxon.TaxonBase;
|
19
|
import eu.etaxonomy.taxeditor.ui.element.CdmFormFactory;
|
20
|
import eu.etaxonomy.taxeditor.ui.element.ICdmFormElement;
|
21
|
import eu.etaxonomy.taxeditor.ui.section.AbstractCdmDetailElement;
|
22
|
import eu.etaxonomy.taxeditor.ui.section.AbstractCdmDetailSection;
|
23
|
import eu.etaxonomy.taxeditor.ui.section.ITaxonBaseDetailSection;
|
24
|
|
25
|
/**
|
26
|
* @author n.hoffmann
|
27
|
* @created 05.06.2009
|
28
|
* @version 1.0
|
29
|
*/
|
30
|
public class AuthorshipDetailSection extends AbstractCdmDetailSection<NonViralName> implements ITaxonBaseDetailSection {
|
31
|
|
32
|
private TaxonBase taxonBase;
|
33
|
|
34
|
public AuthorshipDetailSection(CdmFormFactory cdmFormFactory, ConversationHolder conversation, ICdmFormElement parentElement,
|
35
|
ISelectionProvider selectionProvider, int style) {
|
36
|
super(cdmFormFactory, conversation, parentElement, selectionProvider, style);
|
37
|
}
|
38
|
|
39
|
/** {@inheritDoc} */
|
40
|
@Override
|
41
|
public void setTaxonBase(TaxonBase entity) {
|
42
|
this.taxonBase = entity;
|
43
|
NonViralName name = (NonViralName) HibernateProxyHelper.deproxy(entity.getName());
|
44
|
setEntity(name);
|
45
|
}
|
46
|
|
47
|
/** {@inheritDoc} */
|
48
|
@Override
|
49
|
public String getHeading() {
|
50
|
return "Authorship";
|
51
|
}
|
52
|
|
53
|
@Override
|
54
|
public TaxonBase getTaxonBase() {
|
55
|
return taxonBase;
|
56
|
}
|
57
|
|
58
|
@Override
|
59
|
protected AbstractCdmDetailElement<NonViralName> createCdmDetailElement(AbstractCdmDetailSection<NonViralName> parentElement, int style) {
|
60
|
return formFactory.createAuthorshipDetailElement(parentElement, style);
|
61
|
}
|
62
|
|
63
|
}
|