3 * Copyright (C) 2007 EDIT
4 * European Distributed Institute of Taxonomy
5 * http://www.e-taxonomy.eu
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.
11 package eu
.etaxonomy
.taxeditor
.ui
.section
.name
;
13 import java
.util
.Collection
;
15 import eu
.etaxonomy
.cdm
.api
.conversation
.ConversationHolder
;
16 import eu
.etaxonomy
.cdm
.hibernate
.HibernateProxyHelper
;
17 import eu
.etaxonomy
.cdm
.model
.name
.NomenclaturalStatus
;
18 import eu
.etaxonomy
.cdm
.model
.name
.NonViralName
;
19 import eu
.etaxonomy
.cdm
.model
.name
.TaxonNameBase
;
20 import eu
.etaxonomy
.cdm
.model
.taxon
.TaxonBase
;
21 import eu
.etaxonomy
.taxeditor
.ui
.campanula
.compatibility
.ICdmFormElement
;
22 import eu
.etaxonomy
.taxeditor
.ui
.element
.CdmFormFactory
;
23 import eu
.etaxonomy
.taxeditor
.ui
.section
.AbstractEntityCollectionSection
;
24 import eu
.etaxonomy
.taxeditor
.ui
.section
.ITaxonBaseDetailSection
;
27 * <p>NomenclaturalStatusSection class.</p>
30 * @created Nov 5, 2009
33 public class NomenclaturalStatusSection
extends AbstractEntityCollectionSection
<TaxonNameBase
, NomenclaturalStatus
> implements ITaxonBaseDetailSection
{
35 private TaxonBase taxonBase
;
38 * <p>Constructor for NomenclaturalStatusSection.</p>
40 * @param parentElement a {@link eu.etaxonomy.taxeditor.ui.element.ICdmFormElement} object.
42 * @param cdmFormFactory a {@link eu.etaxonomy.taxeditor.ui.element.CdmFormFactory} object.
43 * @param conversation a {@link eu.etaxonomy.cdm.api.conversation.ConversationHolder} object.
45 public NomenclaturalStatusSection(CdmFormFactory cdmFormFactory
, ConversationHolder conversation
, ICdmFormElement parentElement
,
47 super(cdmFormFactory
, conversation
, parentElement
, "Nomenclatural Status", style
);
52 public Collection
<NomenclaturalStatus
> getCollection(TaxonNameBase entity
) {
53 return entity
.getStatus();
58 public String
getEmptyString() {
59 return "No nomenclatural status yet.";
64 public NomenclaturalStatus
createNewElement() {
65 return NomenclaturalStatus
.NewInstance(null);
70 protected String
getTooltipString() {
71 return "Create a new nomenclatural status";
76 public void addElement(NomenclaturalStatus element
) {
77 getEntity().addStatus(element
);
82 public void removeElement(NomenclaturalStatus element
) {
83 getEntity().removeStatus(element
);
87 public void setTaxonBase(TaxonBase entity
) {
88 this.taxonBase
= entity
;
89 NonViralName nonViralName
= (NonViralName
) HibernateProxyHelper
.deproxy(entity
.getName());
90 setEntity(nonViralName
);
94 * @see eu.etaxonomy.taxeditor.section.ITaxonDetailSection#getTaxon(eu.etaxonomy.cdm.model.taxon.TaxonBase)
97 public TaxonBase
getTaxonBase() {