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
.ui
.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
.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
;
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.ui.element.CdmFormFactory} object.
42 * @param conversation a {@link eu.etaxonomy.cdm.api.conversation.ConversationHolder} object.
43 * @param parentElement a {@link eu.etaxonomy.taxeditor.ui.element.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 public String
getHeading() {
55 return "Nomenclatural Reference";
60 public void setTaxonBase(TaxonBase entity
) {
61 this.taxonBase
= entity
;
62 TaxonNameBase name
= (TaxonNameBase
) HibernateProxyHelper
.deproxy(entity
.getName());
68 protected void setSectionTitle() {
70 if(getEntity() != null && getEntity().getNomenclaturalReference() != null){
71 INomenclaturalReference reference
= getEntity().getNomenclaturalReference();
72 String nomenclaturalCitation
= reference
.getNomenclaturalCitation(getEntity().getNomenclaturalMicroReference());
73 title
= ": " + nomenclaturalCitation
;
75 this.setText(getHeading() + title
);
79 * @see eu.etaxonomy.taxeditor.section.ITaxonDetailSection#getTaxon(eu.etaxonomy.cdm.model.taxon.TaxonBase)
82 public TaxonBase
getTaxonBase() {
87 * @see eu.etaxonomy.taxeditor.ui.section.AbstractCdmDetailSection#createCdmDetailElement(eu.etaxonomy.taxeditor.ui.section.AbstractCdmDetailSection, int)
90 protected AbstractCdmDetailElement
<TaxonNameBase
> createCdmDetailElement(AbstractCdmDetailSection
<TaxonNameBase
> parentElement
, int style
) {
91 return formFactory
.createNomenclaturalReferenceDetailElement(parentElement
, style
);