Merge branch 'hotfix/5.45.1'
[taxeditor.git] / eu.etaxonomy.taxeditor.store / src / main / java / eu / etaxonomy / taxeditor / ui / section / taxon / TaxonBaseDetailSection.java
1 /**
2 * Copyright (C) 2007 EDIT
3 * European Distributed Institute of Taxonomy
4 * http://www.e-taxonomy.eu
5 *
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.
8 */
9 package eu.etaxonomy.taxeditor.ui.section.taxon;
10
11 import org.eclipse.jface.viewers.ISelectionProvider;
12
13 import eu.etaxonomy.cdm.model.taxon.TaxonBase;
14 import eu.etaxonomy.taxeditor.ui.element.CdmFormFactory;
15 import eu.etaxonomy.taxeditor.ui.element.ICdmFormElement;
16 import eu.etaxonomy.taxeditor.ui.section.AbstractCdmDetailElement;
17 import eu.etaxonomy.taxeditor.ui.section.AbstractCdmDetailSection;
18 import eu.etaxonomy.taxeditor.ui.section.ITaxonBaseDetailSection;
19
20 /**
21 * @author n.hoffmann
22 * @created Nov 4, 2009
23 */
24 public class TaxonBaseDetailSection extends AbstractCdmDetailSection<TaxonBase<?>> implements ITaxonBaseDetailSection{
25
26 public TaxonBaseDetailSection(CdmFormFactory cdmFormFactory, ICdmFormElement parentElement, ISelectionProvider selectionProvider, int style) {
27 super(cdmFormFactory, parentElement, selectionProvider, style);
28 }
29
30 @Override
31 public String getHeading() {
32 return getEntity() != null ? getEntity().getClass().getSimpleName() : "Taxon or Synonym";
33 }
34
35 @Override
36 protected AbstractCdmDetailElement<TaxonBase<?>> createCdmDetailElement(AbstractCdmDetailSection<TaxonBase<?>> parentElement, int style) {
37 return formFactory.createTaxonBaseDetailElement(parentElement, style);
38 }
39
40 @Override
41 public void setTaxonBase(TaxonBase<?> taxon) {
42 this.setEntity(taxon);
43
44 }
45
46 @Override
47 public void setTaxonBaseWithoutUpdate(TaxonBase<?> taxon) {
48 setEntityWithoutUpdate(taxon);
49
50 }
51
52 @Override
53 public TaxonBase<?> getTaxonBase() {
54
55 return getEntity();
56 }
57 }