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
.section
.description
;
13 import java
.util
.Collection
;
15 import org
.apache
.log4j
.Logger
;
17 import eu
.etaxonomy
.cdm
.api
.conversation
.ConversationHolder
;
18 import eu
.etaxonomy
.cdm
.api
.facade
.DerivedUnitFacade
;
19 import eu
.etaxonomy
.cdm
.model
.description
.TaxonDescription
;
20 import eu
.etaxonomy
.cdm
.model
.occurrence
.DerivedUnit
;
21 import eu
.etaxonomy
.cdm
.model
.occurrence
.SpecimenOrObservationBase
;
22 import eu
.etaxonomy
.taxeditor
.forms
.CdmFormFactory
;
23 import eu
.etaxonomy
.taxeditor
.forms
.ICdmFormElement
;
24 import eu
.etaxonomy
.taxeditor
.section
.AbstractEntityCollectionSection
;
27 * <p>DescribedSpecimenSection class.</p>
30 * @created Sep 16, 2010
33 public class DescribedSpecimenSection
extends AbstractEntityCollectionSection
<TaxonDescription
, SpecimenOrObservationBase
> {
36 private static final Logger logger
= Logger
37 .getLogger(DescribedSpecimenSection
.class);
40 * <p>Constructor for DescribedSpecimenSection.</p>
42 * @param formFactory a {@link eu.etaxonomy.taxeditor.forms.CdmFormFactory} object.
43 * @param conversation a {@link eu.etaxonomy.cdm.api.conversation.ConversationHolder} object.
44 * @param parentElement a {@link eu.etaxonomy.taxeditor.forms.ICdmFormElement} object.
47 public DescribedSpecimenSection(CdmFormFactory formFactory
,
48 ConversationHolder conversation
, ICdmFormElement parentElement
,
50 super(formFactory
, conversation
, parentElement
, "Described Specimen", style
);
55 public Collection
<SpecimenOrObservationBase
> getCollection(
56 TaxonDescription entity
) {
57 return entity
.getDescribedSpecimenOrObservations();
62 public SpecimenOrObservationBase
createNewElement() {
63 return DerivedUnit
.NewInstance();
68 public void addElement(SpecimenOrObservationBase element
) {
69 getEntity().addDescribedSpecimenOrObservation(element
);
74 public void removeElement(SpecimenOrObservationBase element
) {
75 getEntity().removeDescribedSpecimenOrObservation(element
);
80 public String
getEmptyString() {
81 return "No described specimen yet.";
86 protected String
getTooltipString() {
87 return "Add a described specimen.";