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.
9 package eu
.etaxonomy
.taxeditor
.ui
.section
.name
;
11 import org
.eclipse
.jface
.viewers
.ISelectionProvider
;
13 import eu
.etaxonomy
.cdm
.api
.conversation
.ConversationHolder
;
14 import eu
.etaxonomy
.cdm
.hibernate
.HibernateProxyHelper
;
15 import eu
.etaxonomy
.cdm
.model
.name
.INonViralName
;
16 import eu
.etaxonomy
.cdm
.model
.taxon
.TaxonBase
;
17 import eu
.etaxonomy
.taxeditor
.ui
.element
.CdmFormFactory
;
18 import eu
.etaxonomy
.taxeditor
.ui
.element
.ICdmFormElement
;
19 import eu
.etaxonomy
.taxeditor
.ui
.section
.AbstractCdmDetailElement
;
20 import eu
.etaxonomy
.taxeditor
.ui
.section
.AbstractCdmDetailSection
;
21 import eu
.etaxonomy
.taxeditor
.ui
.section
.ITaxonBaseDetailSection
;
24 * <p>NameDetailSection class.</p>
29 public class NameDetailSection
30 extends AbstractCdmDetailSection
<INonViralName
>
31 implements ITaxonBaseDetailSection
{
33 private TaxonBase
<?
> taxonBase
;
36 * <p>Constructor for NameDetailSection.</p>
38 * @param parentElement a {@link eu.etaxonomy.taxeditor.ui.element.ICdmFormElement} object.
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 selectionProvider a {@link org.eclipse.jface.viewers.ISelectionProvider} object.
44 public NameDetailSection(CdmFormFactory cdmFormFactory
, ConversationHolder conversation
, ICdmFormElement parentElement
,
45 ISelectionProvider selectionProvider
, int style
) {
46 super(cdmFormFactory
, conversation
, parentElement
, selectionProvider
, style
);
50 public void setTaxonBase(TaxonBase entity
) {
51 this.taxonBase
= entity
;
52 INonViralName name
= (INonViralName
) HibernateProxyHelper
.deproxy(entity
.getName());
57 public String
getHeading() {
58 return "Scientific Name";
62 protected void setSectionTitle() {
65 if(getEntity() != null){
66 title
= ": " + getEntity().getNameCache();
68 this.setText(getHeading() + title
);
73 public TaxonBase
<?
> getTaxonBase() {
78 protected AbstractCdmDetailElement
<INonViralName
> createCdmDetailElement(
79 AbstractCdmDetailSection
<INonViralName
> parentElement
, int style
) {
80 return formFactory
.createNameDetailElement(parentElement
, style
);
84 public void updateContent(){
85 ((NameDetailElement
)this.detailElement
).updateContent();