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
.name
.TaxonName
;
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
;
28 public class AuthorshipDetailSection
extends AbstractCdmDetailSection
<INonViralName
> implements ITaxonBaseDetailSection
{
30 private TaxonBase
<?
> taxonBase
;
32 public AuthorshipDetailSection(CdmFormFactory cdmFormFactory
, ConversationHolder conversation
, ICdmFormElement parentElement
,
33 ISelectionProvider selectionProvider
, int style
) {
34 super(cdmFormFactory
, conversation
, parentElement
, selectionProvider
, style
);
38 public void setTaxonBase(TaxonBase entity
) {
39 this.taxonBase
= entity
;
40 INonViralName name
= HibernateProxyHelper
.deproxy(entity
.getName());
45 public String
getHeading() {
50 public TaxonBase
getTaxonBase() {
55 protected void setSectionTitle() {
58 if (getEntity() != null && (getEntity() instanceof TaxonName
) ) {
59 label
=((TaxonName
) getEntity()).getAuthorshipCache();
62 this.setText(String
.format("%s%s", getHeading(), title
));
63 setTextClient(createToolbar());
67 protected AbstractCdmDetailElement
<INonViralName
> createCdmDetailElement(
68 AbstractCdmDetailSection
<INonViralName
> parentElement
, int style
) {
69 return formFactory
.createAuthorshipDetailElement(parentElement
, style
);
72 public void updateContent(){
73 ((AuthorshipDetailElement
)this.detailElement
).updateContent();