2 * Copyright (C) 2007 EDIT
3 * European Distributed Institute of Taxonomy
4 * http://www.e-taxonomy.eu
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.
10 package eu
.etaxonomy
.taxeditor
.ui
.section
.name
;
12 import java
.util
.Collection
;
14 import eu
.etaxonomy
.cdm
.api
.conversation
.ConversationHolder
;
15 import eu
.etaxonomy
.cdm
.hibernate
.HibernateProxyHelper
;
16 import eu
.etaxonomy
.cdm
.model
.name
.NomenclaturalStatus
;
17 import eu
.etaxonomy
.cdm
.model
.name
.NonViralName
;
18 import eu
.etaxonomy
.cdm
.model
.name
.TaxonNameBase
;
19 import eu
.etaxonomy
.cdm
.model
.taxon
.TaxonBase
;
20 import eu
.etaxonomy
.taxeditor
.ui
.element
.CdmFormFactory
;
21 import eu
.etaxonomy
.taxeditor
.ui
.element
.ICdmFormElement
;
22 import eu
.etaxonomy
.taxeditor
.ui
.section
.AbstractEntityCollectionSection
;
23 import eu
.etaxonomy
.taxeditor
.ui
.section
.ITaxonBaseDetailSection
;
26 * <p>NomenclaturalStatusSection class.</p>
29 * @created Nov 5, 2009
32 public class NomenclaturalStatusSection
extends AbstractEntityCollectionSection
<TaxonNameBase
, NomenclaturalStatus
> implements ITaxonBaseDetailSection
{
34 private TaxonBase taxonBase
;
37 * <p>Constructor for NomenclaturalStatusSection.</p>
39 * @param parentElement a {@link eu.etaxonomy.taxeditor.ui.element.ICdmFormElement} object.
41 * @param cdmFormFactory a {@link eu.etaxonomy.taxeditor.ui.element.CdmFormFactory} object.
42 * @param conversation a {@link eu.etaxonomy.cdm.api.conversation.ConversationHolder} object.
44 public NomenclaturalStatusSection(CdmFormFactory cdmFormFactory
, ConversationHolder conversation
, ICdmFormElement parentElement
,
46 super(cdmFormFactory
, conversation
, parentElement
, "Nomenclatural Status", style
);
51 public Collection
<NomenclaturalStatus
> getCollection(TaxonNameBase entity
) {
52 return entity
.getStatus();
57 public String
getEmptyString() {
58 return "No nomenclatural status yet.";
63 public NomenclaturalStatus
createNewElement() {
64 return NomenclaturalStatus
.NewInstance(null);
69 protected String
getTooltipString() {
70 return "Create a new nomenclatural status";
75 public void addElement(NomenclaturalStatus element
) {
76 getEntity().addStatus(element
);
81 public void removeElement(NomenclaturalStatus element
) {
82 getEntity().removeStatus(element
);
86 public void setTaxonBase(TaxonBase entity
) {
87 this.taxonBase
= entity
;
88 NonViralName nonViralName
= (NonViralName
) HibernateProxyHelper
.deproxy(entity
.getName());
89 setEntity(nonViralName
);
93 * @see eu.etaxonomy.taxeditor.section.ITaxonDetailSection#getTaxon(eu.etaxonomy.cdm.model.taxon.TaxonBase)
96 public TaxonBase
getTaxonBase() {