3 * Copyright (C) 2007 EDIT
4 * European Distributed Institute of Taxonomy
5 * http://www.e-taxonomy.eu
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.
11 package eu
.etaxonomy
.taxeditor
.section
.reference
;
13 import org
.eclipse
.jface
.viewers
.ISelectionProvider
;
15 import eu
.etaxonomy
.cdm
.api
.conversation
.ConversationHolder
;
16 import eu
.etaxonomy
.cdm
.hibernate
.HibernateProxyHelper
;
17 import eu
.etaxonomy
.cdm
.model
.name
.TaxonNameBase
;
18 import eu
.etaxonomy
.cdm
.model
.reference
.INomenclaturalReference
;
19 import eu
.etaxonomy
.cdm
.model
.taxon
.TaxonBase
;
20 import eu
.etaxonomy
.taxeditor
.forms
.CdmFormFactory
;
21 import eu
.etaxonomy
.taxeditor
.forms
.CdmFormFactory
.DetailType
;
22 import eu
.etaxonomy
.taxeditor
.forms
.ICdmFormElement
;
23 import eu
.etaxonomy
.taxeditor
.section
.AbstractCdmDetailSection
;
24 import eu
.etaxonomy
.taxeditor
.section
.ITaxonBaseDetailSection
;
27 * <p>NomenclaturalReferenceDetailSection class.</p>
30 * @created Mar 12, 2010
33 public class NomenclaturalReferenceDetailSection
extends
34 AbstractCdmDetailSection
<TaxonNameBase
> implements ITaxonBaseDetailSection
{
36 private TaxonBase taxonBase
;
39 * <p>Constructor for NomenclaturalReferenceDetailSection.</p>
41 * @param cdmFormFactory a {@link eu.etaxonomy.taxeditor.forms.CdmFormFactory} object.
42 * @param conversation a {@link eu.etaxonomy.cdm.api.conversation.ConversationHolder} object.
43 * @param parentElement a {@link eu.etaxonomy.taxeditor.forms.ICdmFormElement} object.
44 * @param selectionProvider a {@link org.eclipse.jface.viewers.ISelectionProvider} object.
47 public NomenclaturalReferenceDetailSection(CdmFormFactory cdmFormFactory
, ConversationHolder conversation
,
48 ICdmFormElement parentElement
, ISelectionProvider selectionProvider
, int style
) {
49 super(cdmFormFactory
, conversation
, parentElement
, selectionProvider
, style
);
54 protected DetailType
getDetailType() {
55 return DetailType
.NOMENCLATURALREFERENCE
;
60 public String
getHeading() {
61 return "Nomenclatural Reference";
65 public void setTaxonBase(TaxonBase entity
) {
66 this.taxonBase
= entity
;
67 TaxonNameBase name
= (TaxonNameBase
) HibernateProxyHelper
.deproxy(entity
.getName());
73 protected void setSectionTitle() {
75 if(getEntity() != null && getEntity().getNomenclaturalReference() != null){
76 INomenclaturalReference reference
= getEntity().getNomenclaturalReference();
77 String nomenclaturalCitation
= reference
.getNomenclaturalCitation(getEntity().getNomenclaturalMicroReference());
78 title
= ": " + nomenclaturalCitation
;
80 this.setText(getHeading() + title
);
84 * @see eu.etaxonomy.taxeditor.section.ITaxonDetailSection#getTaxon(eu.etaxonomy.cdm.model.taxon.TaxonBase)
87 public TaxonBase
getTaxonBase() {