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 eu
.etaxonomy
.cdm
.api
.conversation
.ConversationHolder
;
16 import eu
.etaxonomy
.cdm
.model
.description
.TaxonDescription
;
17 import eu
.etaxonomy
.cdm
.model
.occurrence
.DerivedUnit
;
18 import eu
.etaxonomy
.cdm
.model
.occurrence
.SpecimenOrObservationBase
;
19 import eu
.etaxonomy
.taxeditor
.forms
.CdmFormFactory
;
20 import eu
.etaxonomy
.taxeditor
.forms
.ICdmFormElement
;
21 import eu
.etaxonomy
.taxeditor
.section
.AbstractEntityCollectionSection
;
24 * <p>DescribedSpecimenSection class.</p>
27 * @created Sep 16, 2010
30 public class DescribedSpecimenSection
extends AbstractEntityCollectionSection
<TaxonDescription
, SpecimenOrObservationBase
> {
33 * <p>Constructor for DescribedSpecimenSection.</p>
35 * @param formFactory a {@link eu.etaxonomy.taxeditor.forms.CdmFormFactory} object.
36 * @param conversation a {@link eu.etaxonomy.cdm.api.conversation.ConversationHolder} object.
37 * @param parentElement a {@link eu.etaxonomy.taxeditor.forms.ICdmFormElement} object.
40 public DescribedSpecimenSection(CdmFormFactory formFactory
,
41 ConversationHolder conversation
, ICdmFormElement parentElement
,
43 super(formFactory
, conversation
, parentElement
, "Described Specimen", style
);
48 public Collection
<SpecimenOrObservationBase
> getCollection(
49 TaxonDescription entity
) {
50 return entity
.getDescribedSpecimenOrObservations();
55 public SpecimenOrObservationBase
createNewElement() {
56 return DerivedUnit
.NewInstance();
61 public void addElement(SpecimenOrObservationBase element
) {
62 getEntity().addDescribedSpecimenOrObservation(element
);
67 public void removeElement(SpecimenOrObservationBase element
) {
68 getEntity().removeDescribedSpecimenOrObservation(element
);
73 public String
getEmptyString() {
74 return "No described specimen yet.";
79 protected String
getTooltipString() {
80 return "Add a described specimen.";