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
.name
;
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
.INonViralName
;
17 import eu
.etaxonomy
.cdm
.model
.taxon
.TaxonBase
;
18 import eu
.etaxonomy
.taxeditor
.ui
.element
.CdmFormFactory
;
19 import eu
.etaxonomy
.taxeditor
.ui
.element
.ICdmFormElement
;
20 import eu
.etaxonomy
.taxeditor
.ui
.section
.AbstractCdmDetailElement
;
21 import eu
.etaxonomy
.taxeditor
.ui
.section
.AbstractCdmDetailSection
;
22 import eu
.etaxonomy
.taxeditor
.ui
.section
.ITaxonBaseDetailSection
;
25 * <p>NameDetailSection class.</p>
30 public class NameDetailSection
extends AbstractCdmDetailSection
<INonViralName
> implements ITaxonBaseDetailSection
{
32 private TaxonBase taxonBase
;
35 * <p>Constructor for NameDetailSection.</p>
37 * @param parentElement a {@link eu.etaxonomy.taxeditor.ui.element.ICdmFormElement} object.
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 selectionProvider a {@link org.eclipse.jface.viewers.ISelectionProvider} object.
43 public NameDetailSection(CdmFormFactory cdmFormFactory
, ConversationHolder conversation
, ICdmFormElement parentElement
,
44 ISelectionProvider selectionProvider
, int style
) {
45 super(cdmFormFactory
, conversation
, parentElement
, selectionProvider
, style
);
50 public void setTaxonBase(TaxonBase entity
) {
51 this.taxonBase
= entity
;
52 INonViralName name
= (INonViralName
) HibernateProxyHelper
.deproxy(entity
.getName());
58 public String
getHeading() {
59 return "Scientific Name";
64 protected void setSectionTitle() {
67 if(getEntity() != null){
68 title
= ": " + getEntity().getNameCache();
70 this.setText(getHeading() + title
);
75 public TaxonBase
getTaxonBase() {
80 protected AbstractCdmDetailElement
<INonViralName
> createCdmDetailElement(
81 AbstractCdmDetailSection
<INonViralName
> parentElement
, int style
) {
82 return formFactory
.createNameDetailElement(parentElement
, style
);
86 public void updateContent(){
87 ((NameDetailElement
)this.detailElement
).updateContent();