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.taxon;
|
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.taxon.TaxonBase;
|
18
|
import eu.etaxonomy.taxeditor.ui.element.CdmFormFactory;
|
19
|
import eu.etaxonomy.taxeditor.ui.section.AbstractCdmDetailElement;
|
20
|
import eu.etaxonomy.taxeditor.ui.section.AbstractCdmDetailSection;
|
21
|
import eu.etaxonomy.taxeditor.ui.section.ITaxonBaseDetailSection;
|
22
|
import eu.etaxonomy.taxeditor.ui.section.campanula.compatibility.ICdmFormElement;
|
23
|
|
24
|
/**
|
25
|
* <p>TaxonBaseDetailSection class.</p>
|
26
|
*
|
27
|
* @author n.hoffmann
|
28
|
* @created Nov 4, 2009
|
29
|
* @version 1.0
|
30
|
*/
|
31
|
public class TaxonBaseDetailSection extends AbstractCdmDetailSection<TaxonBase> implements ITaxonBaseDetailSection{
|
32
|
|
33
|
private TaxonBase taxonBase;
|
34
|
|
35
|
/**
|
36
|
* <p>Constructor for TaxonBaseDetailSection.</p>
|
37
|
*
|
38
|
* @param parentElement a {@link eu.etaxonomy.taxeditor.ui.element.ICdmFormElement} object.
|
39
|
* @param style a int.
|
40
|
* @param cdmFormFactory a {@link eu.etaxonomy.taxeditor.ui.element.CdmFormFactory} object.
|
41
|
* @param conversation a {@link eu.etaxonomy.cdm.api.conversation.ConversationHolder} object.
|
42
|
* @param selectionProvider a {@link org.eclipse.jface.viewers.ISelectionProvider} object.
|
43
|
*/
|
44
|
public TaxonBaseDetailSection(CdmFormFactory cdmFormFactory, ConversationHolder conversation, ICdmFormElement parentElement, ISelectionProvider selectionProvider, int style) {
|
45
|
super(cdmFormFactory, conversation, parentElement, selectionProvider, style);
|
46
|
}
|
47
|
|
48
|
/*
|
49
|
* (non-Javadoc)
|
50
|
* @see eu.etaxonomy.taxeditor.section.ITaxonDetailSection#setTaxon(eu.etaxonomy.cdm.model.taxon.TaxonBase)
|
51
|
*/
|
52
|
/** {@inheritDoc} */
|
53
|
@Override
|
54
|
public void setTaxonBase(TaxonBase entity) {
|
55
|
this.taxonBase = entity;
|
56
|
TaxonBase taxonBase = (TaxonBase) HibernateProxyHelper.deproxy(entity);
|
57
|
setEntity(taxonBase);
|
58
|
}
|
59
|
|
60
|
/** {@inheritDoc} */
|
61
|
@Override
|
62
|
public String getHeading() {
|
63
|
return getEntity() != null ? getEntity().getClass().getSimpleName() : "TaxonBase";
|
64
|
}
|
65
|
|
66
|
/* (non-Javadoc)
|
67
|
* @see eu.etaxonomy.taxeditor.section.ITaxonDetailSection#getTaxon(eu.etaxonomy.cdm.model.taxon.TaxonBase)
|
68
|
*/
|
69
|
@Override
|
70
|
public TaxonBase getTaxonBase() {
|
71
|
return taxonBase;
|
72
|
}
|
73
|
|
74
|
/* (non-Javadoc)
|
75
|
* @see eu.etaxonomy.taxeditor.ui.section.AbstractCdmDetailSection#createCdmDetailElement(eu.etaxonomy.taxeditor.ui.section.AbstractCdmDetailSection, int)
|
76
|
*/
|
77
|
@Override
|
78
|
protected AbstractCdmDetailElement<TaxonBase> createCdmDetailElement(AbstractCdmDetailSection<TaxonBase> parentElement, int style) {
|
79
|
return formFactory.createTaxonBaseDetailElement(parentElement, style);
|
80
|
}
|
81
|
|
82
|
}
|