performed javacscript:fix and worked on documentation
[taxeditor.git] / taxeditor-editor / src / main / java / eu / etaxonomy / taxeditor / section / taxon / TaxonBaseDetailSection.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.taxon;
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.taxon.TaxonBase;
19 import eu.etaxonomy.taxeditor.forms.CdmFormFactory;
20 import eu.etaxonomy.taxeditor.forms.ICdmFormElement;
21 import eu.etaxonomy.taxeditor.forms.CdmFormFactory.DetailType;
22 import eu.etaxonomy.taxeditor.section.AbstractCdmDetailSection;
23 import eu.etaxonomy.taxeditor.section.ITaxonDetailSection;
24
25 /**
26 * <p>TaxonBaseDetailSection class.</p>
27 *
28 * @author n.hoffmann
29 * @created Nov 4, 2009
30 * @version 1.0
31 */
32 public class TaxonBaseDetailSection extends AbstractCdmDetailSection<TaxonBase> implements ITaxonDetailSection{
33
34 private static final Logger logger = Logger
35 .getLogger(TaxonBaseDetailSection.class);
36
37 /**
38 * <p>Constructor for TaxonBaseDetailSection.</p>
39 *
40 * @param parentElement a {@link eu.etaxonomy.taxeditor.forms.ICdmFormElement} object.
41 * @param style a int.
42 * @param cdmFormFactory a {@link eu.etaxonomy.taxeditor.forms.CdmFormFactory} object.
43 * @param conversation a {@link eu.etaxonomy.cdm.api.conversation.ConversationHolder} object.
44 * @param selectionProvider a {@link org.eclipse.jface.viewers.ISelectionProvider} object.
45 */
46 public TaxonBaseDetailSection(CdmFormFactory cdmFormFactory, ConversationHolder conversation, ICdmFormElement parentElement, ISelectionProvider selectionProvider, int style) {
47 super(cdmFormFactory, conversation, parentElement, selectionProvider, style);
48 }
49
50 /*
51 * (non-Javadoc)
52 * @see eu.etaxonomy.taxeditor.section.ITaxonDetailSection#setTaxon(eu.etaxonomy.cdm.model.taxon.TaxonBase)
53 */
54 /** {@inheritDoc} */
55 public void setTaxon(TaxonBase taxon) {
56 TaxonBase taxonBase = (TaxonBase) HibernateProxyHelper.deproxy(taxon);
57 setEntity(taxonBase);
58 }
59
60 /** {@inheritDoc} */
61 @Override
62 public String getHeading() {
63 return getEntity() != null ? getEntity().getClass().getSimpleName() : "TaxonBase";
64 }
65
66 /** {@inheritDoc} */
67 @Override
68 protected DetailType getDetailType() {
69 return DetailType.TAXONBASE;
70 }
71
72 }