Project

General

Profile

Download (2.3 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.name.TaxonName;
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
import eu.etaxonomy.taxeditor.ui.section.description.detail.AbstractDetailedDescriptionDetailElement;
25

    
26
/**
27
 * @author n.hoffmann
28
 * @created Jan 5, 2011
29
 */
30
public class HybridDetailSection extends AbstractCdmDetailSection<TaxonName> implements
31
		ITaxonBaseDetailSection {
32

    
33
	private TaxonBase taxonBase;
34

    
35
	/**
36
	 * @param formFactory
37
	 * @param conversation
38
	 * @param parentElement
39
	 * @param selectionProvider
40
	 * @param style
41
	 */
42
	public HybridDetailSection(CdmFormFactory formFactory,
43
			ConversationHolder conversation, ICdmFormElement parentElement,
44
			ISelectionProvider selectionProvider, int style) {
45
		super(formFactory, conversation, parentElement, selectionProvider, style);
46
	}
47

    
48
	@Override
49
	public void setTaxonBase(TaxonBase taxon) {
50
		taxonBase = taxon;
51
		TaxonName name = HibernateProxyHelper.deproxy(taxon.getName());
52
		setEntity(name);
53
	}
54

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

    
60
	@Override
61
	public String getHeading() {
62
		return "Hybrid";
63
	}
64

    
65
	@Override
66
	protected void setSectionTitle() {
67
		setText(getHeading());
68
	}
69

    
70
	@Override
71
	protected AbstractCdmDetailElement createCdmDetailElement(
72
			AbstractCdmDetailSection<TaxonName> parentElement, int style) {
73
        //FIXME generic
74
	    return formFactory.createHybridDetailElement(parentElement);
75
	}
76

    
77
	public void updateContent() {
78
		((AbstractCdmDetailElement)this.detailElement).setEntity(getEntity());
79
		
80
	}
81

    
82
}
(5-5/21)