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.reference;
|
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.reference.Reference;
|
19
|
import eu.etaxonomy.cdm.model.taxon.TaxonBase;
|
20
|
import eu.etaxonomy.taxeditor.store.StoreUtil;
|
21
|
import eu.etaxonomy.taxeditor.ui.element.CdmFormFactory;
|
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
|
import eu.etaxonomy.taxeditor.ui.section.campanula.compatibility.ICdmFormElement;
|
26
|
|
27
|
/**
|
28
|
* <p>ReferenceBaseDetailSection class.</p>
|
29
|
*
|
30
|
* @author n.hoffmann
|
31
|
* @created 05.06.2009
|
32
|
* @version 1.0
|
33
|
*/
|
34
|
public class ReferenceDetailSection extends AbstractCdmDetailSection<Reference> implements ITaxonBaseDetailSection{
|
35
|
|
36
|
private TaxonBase taxonBase;
|
37
|
|
38
|
/**
|
39
|
* <p>Constructor for ReferenceBaseDetailSection.</p>
|
40
|
*
|
41
|
* @param parentElement a {@link eu.etaxonomy.taxeditor.ui.element.ICdmFormElement} object.
|
42
|
* @param style a int.
|
43
|
* @param cdmFormFactory a {@link eu.etaxonomy.taxeditor.ui.element.CdmFormFactory} object.
|
44
|
* @param conversation a {@link eu.etaxonomy.cdm.api.conversation.ConversationHolder} object.
|
45
|
* @param selectionProvider a {@link org.eclipse.jface.viewers.ISelectionProvider} object.
|
46
|
*/
|
47
|
public ReferenceDetailSection(CdmFormFactory cdmFormFactory, ConversationHolder conversation, ICdmFormElement parentElement,
|
48
|
ISelectionProvider selectionProvider, int style) {
|
49
|
super(cdmFormFactory, conversation, parentElement, selectionProvider, style);
|
50
|
}
|
51
|
|
52
|
/*
|
53
|
* (non-Javadoc)
|
54
|
* @see eu.etaxonomy.taxeditor.section.ITaxonDetailSection#setTaxon(eu.etaxonomy.cdm.model.taxon.TaxonBase)
|
55
|
*/
|
56
|
/** {@inheritDoc} */
|
57
|
@Override
|
58
|
public void setTaxonBase(TaxonBase entity) {
|
59
|
this.taxonBase = entity;
|
60
|
NonViralName name = (NonViralName) HibernateProxyHelper.deproxy(entity.getName());
|
61
|
|
62
|
Reference reference = (Reference) HibernateProxyHelper.deproxy(name.getNomenclaturalReference());
|
63
|
|
64
|
setEntity(reference);
|
65
|
}
|
66
|
|
67
|
/*
|
68
|
* (non-Javadoc)
|
69
|
* @see eu.etaxonomy.taxeditor.forms.section.cdmdetail.AbstractCdmDetailSection#getHeading()
|
70
|
*/
|
71
|
/** {@inheritDoc} */
|
72
|
@Override
|
73
|
public String getHeading() {
|
74
|
return "Reference";
|
75
|
}
|
76
|
|
77
|
/** {@inheritDoc} */
|
78
|
@Override
|
79
|
public void refresh() {
|
80
|
super.refresh();
|
81
|
StoreUtil.refreshDetailsViewer();
|
82
|
}
|
83
|
|
84
|
/* (non-Javadoc)
|
85
|
* @see eu.etaxonomy.taxeditor.section.ITaxonDetailSection#getTaxon(eu.etaxonomy.cdm.model.taxon.TaxonBase)
|
86
|
*/
|
87
|
@Override
|
88
|
public TaxonBase getTaxonBase() {
|
89
|
return taxonBase;
|
90
|
}
|
91
|
|
92
|
/* (non-Javadoc)
|
93
|
* @see eu.etaxonomy.taxeditor.ui.section.AbstractCdmDetailSection#createCdmDetailElement(eu.etaxonomy.taxeditor.ui.section.AbstractCdmDetailSection, int)
|
94
|
*/
|
95
|
@Override
|
96
|
protected AbstractCdmDetailElement<Reference> createCdmDetailElement(AbstractCdmDetailSection<Reference> parentElement, int style) {
|
97
|
return formFactory.createReferenceDetailElement(parentElement, style);
|
98
|
}
|
99
|
|
100
|
}
|