performed javacscript:fix and worked on documentation
[taxeditor.git] / taxeditor-editor / src / main / java / eu / etaxonomy / taxeditor / section / name / AuthorshipDetailSection.java
1 // $Id$
2 /**
3 * Copyright (C) 2007 EDIT
4 * European Distributed Institute of Taxonomy
5 * http://www.e-taxonomy.eu
6 *
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.
9 */
10
11 package eu.etaxonomy.taxeditor.section.name;
12
13 import org.apache.log4j.Logger;
14 import org.eclipse.jface.viewers.ISelectionProvider;
15
16 import eu.etaxonomy.cdm.api.conversation.ConversationHolder;
17 import eu.etaxonomy.cdm.hibernate.HibernateProxyHelper;
18 import eu.etaxonomy.cdm.model.name.NonViralName;
19 import eu.etaxonomy.cdm.model.taxon.TaxonBase;
20 import eu.etaxonomy.taxeditor.forms.CdmFormFactory;
21 import eu.etaxonomy.taxeditor.forms.ICdmFormElement;
22 import eu.etaxonomy.taxeditor.forms.CdmFormFactory.DetailType;
23 import eu.etaxonomy.taxeditor.section.AbstractCdmDetailSection;
24 import eu.etaxonomy.taxeditor.section.ITaxonDetailSection;
25
26 /**
27 * <p>AuthorshipDetailSection class.</p>
28 *
29 * @author n.hoffmann
30 * @created 05.06.2009
31 * @version 1.0
32 */
33 public class AuthorshipDetailSection extends AbstractCdmDetailSection<NonViralName> implements ITaxonDetailSection {
34
35
36 private static final Logger logger = Logger.getLogger(AuthorshipDetailSection.class);
37
38
39 /**
40 * <p>Constructor for AuthorshipDetailSection.</p>
41 *
42 * @param parentElement a {@link eu.etaxonomy.taxeditor.forms.ICdmFormElement} object.
43 * @param style a int.
44 * @param cdmFormFactory a {@link eu.etaxonomy.taxeditor.forms.CdmFormFactory} object.
45 * @param conversation a {@link eu.etaxonomy.cdm.api.conversation.ConversationHolder} object.
46 * @param selectionProvider a {@link org.eclipse.jface.viewers.ISelectionProvider} object.
47 */
48 public AuthorshipDetailSection(CdmFormFactory cdmFormFactory, ConversationHolder conversation, ICdmFormElement parentElement,
49 ISelectionProvider selectionProvider, int style) {
50 super(cdmFormFactory, conversation, parentElement, selectionProvider, style);
51 }
52
53 /**
54 * {@inheritDoc}
55 *
56 * Author title is not in titleCache field
57 * @see eu.etaxonomy.taxeditor.section.AbstractCdmDetailSection#setSectionTitle()
58 */
59 @Override
60 protected void setSectionTitle() {
61 if(getEntity() != null){
62 this.setText(getHeading() + ": " + getEntity().getAuthorshipCache());
63 }
64 }
65
66 /** {@inheritDoc} */
67 public void setTaxon(TaxonBase entity) {
68 NonViralName name = (NonViralName) HibernateProxyHelper.deproxy(entity.getName());
69 setEntity(name);
70 }
71
72 /*
73 * (non-Javadoc)
74 * @see eu.etaxonomy.taxeditor.forms.section.cdmdetail.AbstractCdmDetailSection#getHeading()
75 */
76 /** {@inheritDoc} */
77 @Override
78 public String getHeading() {
79 return "Authorship";
80 }
81
82 /** {@inheritDoc} */
83 @Override
84 protected DetailType getDetailType() {
85 return DetailType.AUTHORSHIP;
86 }
87
88 }