2 * Copyright (C) 2007 EDIT
3 * European Distributed Institute of Taxonomy
4 * http://www.e-taxonomy.eu
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.
10 package eu
.etaxonomy
.taxeditor
.ui
.section
.reference
;
12 import org
.eclipse
.jface
.viewers
.ISelectionProvider
;
14 import eu
.etaxonomy
.cdm
.api
.conversation
.ConversationHolder
;
15 import eu
.etaxonomy
.cdm
.hibernate
.HibernateProxyHelper
;
16 import eu
.etaxonomy
.cdm
.model
.name
.TaxonNameBase
;
17 import eu
.etaxonomy
.cdm
.model
.reference
.INomenclaturalReference
;
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
;
26 * <p>NomenclaturalReferenceDetailSection class.</p>
29 * @created Mar 12, 2010
32 public class NomenclaturalReferenceDetailSection
extends
33 AbstractCdmDetailSection
<TaxonNameBase
> implements ITaxonBaseDetailSection
{
35 private TaxonBase taxonBase
;
38 * <p>Constructor for NomenclaturalReferenceDetailSection.</p>
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 parentElement a {@link eu.etaxonomy.taxeditor.ui.element.ICdmFormElement} object.
43 * @param selectionProvider a {@link org.eclipse.jface.viewers.ISelectionProvider} object.
46 public NomenclaturalReferenceDetailSection(CdmFormFactory cdmFormFactory
, ConversationHolder conversation
,
47 ICdmFormElement parentElement
, ISelectionProvider selectionProvider
, int style
) {
48 super(cdmFormFactory
, conversation
, parentElement
, selectionProvider
, style
);
53 public String
getHeading() {
54 return "Nomenclatural Reference";
59 public void setTaxonBase(TaxonBase entity
) {
60 this.taxonBase
= entity
;
61 TaxonNameBase name
= (TaxonNameBase
) HibernateProxyHelper
.deproxy(entity
.getName());
67 protected void setSectionTitle() {
69 if(getEntity() != null && getEntity().getNomenclaturalReference() != null){
70 INomenclaturalReference reference
= getEntity().getNomenclaturalReference();
71 String nomenclaturalCitation
= reference
.getNomenclaturalCitation(getEntity().getNomenclaturalMicroReference());
72 title
= ": " + nomenclaturalCitation
;
74 this.setText(getHeading() + title
);
78 * @see eu.etaxonomy.taxeditor.section.ITaxonDetailSection#getTaxon(eu.etaxonomy.cdm.model.taxon.TaxonBase)
81 public TaxonBase
getTaxonBase() {
86 * @see eu.etaxonomy.taxeditor.ui.section.AbstractCdmDetailSection#createCdmDetailElement(eu.etaxonomy.taxeditor.ui.section.AbstractCdmDetailSection, int)
89 protected AbstractCdmDetailElement
<TaxonNameBase
> createCdmDetailElement(AbstractCdmDetailSection
<TaxonNameBase
> parentElement
, int style
) {
90 return formFactory
.createNomenclaturalReferenceDetailElement(parentElement
, style
);