Project

General

Profile

Download (2.06 KB) Statistics
| Branch: | Tag: | Revision:
1
/**
2
* Copyright (C) 2007 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

    
10
package eu.etaxonomy.taxeditor.ui.section.name;
11

    
12
import org.eclipse.jface.viewers.ISelectionProvider;
13

    
14
import eu.etaxonomy.cdm.api.conversation.ConversationHolder;
15
import eu.etaxonomy.cdm.hibernate.HibernateProxyHelper;
16
import eu.etaxonomy.cdm.model.name.INonViralName;
17
import eu.etaxonomy.cdm.model.taxon.TaxonBase;
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
import eu.etaxonomy.taxeditor.ui.section.ITaxonBaseDetailSection;
23

    
24
/**
25
 * @author n.hoffmann
26
 * @created 05.06.2009
27
 * @version 1.0
28
 */
29
public class AuthorshipDetailSection extends AbstractCdmDetailSection<INonViralName> implements ITaxonBaseDetailSection {
30

    
31
	private TaxonBase taxonBase;
32

    
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

    
40
	/** {@inheritDoc} */
41
	@Override
42
    public void setTaxonBase(TaxonBase entity) {
43
		this.taxonBase = entity;
44
		INonViralName name = (INonViralName) HibernateProxyHelper.deproxy(entity.getName());
45
		setEntity(name);
46
	}
47

    
48
	/** {@inheritDoc} */
49
	@Override
50
	public String getHeading() {
51
		return "Authorship";
52
	}
53

    
54
	@Override
55
	public TaxonBase getTaxonBase() {
56
		return taxonBase;
57
	}
58

    
59
	@Override
60
	protected AbstractCdmDetailElement<INonViralName> createCdmDetailElement(
61
			AbstractCdmDetailSection<INonViralName> parentElement, int style) {
62
	    return formFactory.createAuthorshipDetailElement(parentElement, style);
63
	}
64
	
65
	public void updateContent(){
66
		((AuthorshipDetailElement)this.detailElement).updateContent();
67
	}
68

    
69
}
(3-3/21)