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
.TaxonName
;
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
31 public class NomenclaturalReferenceDetailSection
extends
32 AbstractCdmDetailSection
<TaxonName
> implements ITaxonBaseDetailSection
{
34 private TaxonBase taxonBase
;
37 * <p>Constructor for NomenclaturalReferenceDetailSection.</p>
39 * @param cdmFormFactory a {@link eu.etaxonomy.taxeditor.ui.element.CdmFormFactory} object.
40 * @param conversation a {@link eu.etaxonomy.cdm.api.conversation.ConversationHolder} object.
41 * @param parentElement a {@link eu.etaxonomy.taxeditor.ui.element.ICdmFormElement} object.
42 * @param selectionProvider a {@link org.eclipse.jface.viewers.ISelectionProvider} object.
45 public NomenclaturalReferenceDetailSection(CdmFormFactory cdmFormFactory
, ConversationHolder conversation
,
46 ICdmFormElement parentElement
, ISelectionProvider selectionProvider
, int style
) {
47 super(cdmFormFactory
, conversation
, parentElement
, selectionProvider
, style
);
52 public String
getHeading() {
53 return "Nomenclatural Reference";
58 public void setTaxonBase(TaxonBase entity
) {
59 this.taxonBase
= entity
;
60 TaxonName name
= (TaxonName
) HibernateProxyHelper
.deproxy(entity
.getName());
66 protected void setSectionTitle() {
68 if(getEntity() != null && getEntity().getNomenclaturalReference() != null){
69 INomenclaturalReference reference
= getEntity().getNomenclaturalReference();
70 String nomenclaturalCitation
= reference
.getNomenclaturalCitation(getEntity().getNomenclaturalMicroReference());
71 title
= ": " + nomenclaturalCitation
;
73 this.setText(getHeading() + title
);
77 public TaxonBase
getTaxonBase() {
82 protected AbstractCdmDetailElement
<TaxonName
> createCdmDetailElement(
83 AbstractCdmDetailSection
<TaxonName
> parentElement
, int style
) {
84 return formFactory
.createNomenclaturalReferenceDetailElement(parentElement
, style
);