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.name.TaxonNameBase;
|
19
|
import eu.etaxonomy.cdm.model.taxon.TaxonBase;
|
20
|
import eu.etaxonomy.taxeditor.ui.element.CdmFormFactory;
|
21
|
import eu.etaxonomy.taxeditor.ui.element.ICdmFormElement;
|
22
|
import eu.etaxonomy.taxeditor.ui.section.AbstractCdmDetailElement;
|
23
|
import eu.etaxonomy.taxeditor.ui.section.AbstractCdmDetailSection;
|
24
|
import eu.etaxonomy.taxeditor.ui.section.ITaxonBaseDetailSection;
|
25
|
|
26
|
/**
|
27
|
* @author n.hoffmann
|
28
|
* @created Jan 5, 2011
|
29
|
* @version 1.0
|
30
|
*/
|
31
|
public class HybridDetailSection extends AbstractCdmDetailSection<TaxonNameBase> implements
|
32
|
ITaxonBaseDetailSection {
|
33
|
|
34
|
private TaxonBase taxonBase;
|
35
|
|
36
|
/**
|
37
|
* @param formFactory
|
38
|
* @param conversation
|
39
|
* @param parentElement
|
40
|
* @param selectionProvider
|
41
|
* @param style
|
42
|
*/
|
43
|
public HybridDetailSection(CdmFormFactory formFactory,
|
44
|
ConversationHolder conversation, ICdmFormElement parentElement,
|
45
|
ISelectionProvider selectionProvider, int style) {
|
46
|
super(formFactory, conversation, parentElement, selectionProvider, style);
|
47
|
}
|
48
|
|
49
|
|
50
|
/* (non-Javadoc)
|
51
|
* @see eu.etaxonomy.taxeditor.section.ITaxonBaseDetailSection#setTaxonBase(eu.etaxonomy.cdm.model.taxon.TaxonBase)
|
52
|
*/
|
53
|
@Override
|
54
|
public void setTaxonBase(TaxonBase taxon) {
|
55
|
taxonBase = taxon;
|
56
|
NonViralName name = (NonViralName) HibernateProxyHelper.deproxy(taxon.getName());
|
57
|
setEntity(name);
|
58
|
}
|
59
|
|
60
|
/* (non-Javadoc)
|
61
|
* @see eu.etaxonomy.taxeditor.section.ITaxonBaseDetailSection#getTaxonBase()
|
62
|
*/
|
63
|
@Override
|
64
|
public TaxonBase getTaxonBase() {
|
65
|
return taxonBase;
|
66
|
}
|
67
|
|
68
|
/* (non-Javadoc)
|
69
|
* @see eu.etaxonomy.taxeditor.section.AbstractCdmDetailSection#getHeading()
|
70
|
*/
|
71
|
@Override
|
72
|
public String getHeading() {
|
73
|
return "Hybrid";
|
74
|
}
|
75
|
|
76
|
/* (non-Javadoc)
|
77
|
* @see eu.etaxonomy.taxeditor.section.AbstractCdmDetailSection#setSectionTitle()
|
78
|
*/
|
79
|
@Override
|
80
|
protected void setSectionTitle() {
|
81
|
setText(getHeading());
|
82
|
}
|
83
|
|
84
|
/* (non-Javadoc)
|
85
|
* @see eu.etaxonomy.taxeditor.ui.section.AbstractCdmDetailSection#createCdmDetailElement(eu.etaxonomy.taxeditor.ui.section.AbstractCdmDetailSection, int)
|
86
|
*/
|
87
|
@Override
|
88
|
protected AbstractCdmDetailElement createCdmDetailElement(AbstractCdmDetailSection<TaxonNameBase> parentElement, int style) {
|
89
|
//FIXME generic
|
90
|
return formFactory.createHybridDetailElement(parentElement);
|
91
|
}
|
92
|
|
93
|
}
|