refactoring of package names for consistency
[taxeditor.git] / eu.etaxonomy.taxeditor.store / src / main / java / eu / etaxonomy / taxeditor / ui / 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.ui.section.name;
12
13 import org.eclipse.jface.viewers.ISelectionProvider;
14
15 import eu.etaxonomy.cdm.api.conversation.ConversationHolder;
16 import eu.etaxonomy.cdm.hibernate.HibernateProxyHelper;
17 import eu.etaxonomy.cdm.model.name.NonViralName;
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.element.CdmFormFactory.DetailType;
22 import eu.etaxonomy.taxeditor.ui.section.AbstractCdmDetailSection;
23 import eu.etaxonomy.taxeditor.ui.section.ITaxonBaseDetailSection;
24
25 /**
26 * <p>AuthorshipDetailSection class.</p>
27 *
28 * @author n.hoffmann
29 * @created 05.06.2009
30 * @version 1.0
31 */
32 public class AuthorshipDetailSection extends AbstractCdmDetailSection<NonViralName> implements ITaxonBaseDetailSection {
33
34 private TaxonBase taxonBase;
35
36 /**
37 * <p>Constructor for AuthorshipDetailSection.</p>
38 *
39 * @param parentElement a {@link eu.etaxonomy.taxeditor.ui.element.ICdmFormElement} object.
40 * @param style a int.
41 * @param cdmFormFactory a {@link eu.etaxonomy.taxeditor.ui.element.CdmFormFactory} object.
42 * @param conversation a {@link eu.etaxonomy.cdm.api.conversation.ConversationHolder} object.
43 * @param selectionProvider a {@link org.eclipse.jface.viewers.ISelectionProvider} object.
44 */
45 public AuthorshipDetailSection(CdmFormFactory cdmFormFactory, ConversationHolder conversation, ICdmFormElement parentElement,
46 ISelectionProvider selectionProvider, int style) {
47 super(cdmFormFactory, conversation, parentElement, selectionProvider, style);
48 }
49
50 /**
51 * {@inheritDoc}
52 *
53 * Author title is not in titleCache field
54 * @see eu.etaxonomy.taxeditor.ui.section.AbstractCdmDetailSection#setSectionTitle()
55 */
56 @Override
57 protected void setSectionTitle() {
58 if(getEntity() != null){
59 this.setText(getHeading() + ": " + getEntity().getAuthorshipCache());
60 }
61 }
62
63 /** {@inheritDoc} */
64 public void setTaxonBase(TaxonBase entity) {
65 this.taxonBase = entity;
66 NonViralName name = (NonViralName) HibernateProxyHelper.deproxy(entity.getName());
67 setEntity(name);
68 }
69
70 /*
71 * (non-Javadoc)
72 * @see eu.etaxonomy.taxeditor.forms.section.cdmdetail.AbstractCdmDetailSection#getHeading()
73 */
74 /** {@inheritDoc} */
75 @Override
76 public String getHeading() {
77 return "Authorship";
78 }
79
80 /** {@inheritDoc} */
81 @Override
82 protected DetailType getDetailType() {
83 return DetailType.AUTHORSHIP;
84 }
85
86 /* (non-Javadoc)
87 * @see eu.etaxonomy.taxeditor.section.ITaxonDetailSection#getTaxon(eu.etaxonomy.cdm.model.taxon.TaxonBase)
88 */
89 @Override
90 public TaxonBase getTaxonBase() {
91 return taxonBase;
92 }
93
94 }