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
.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
.DerivedUnitBase
;
18 import eu
.etaxonomy
.cdm
.model
.occurrence
.SpecimenOrObservationBase
;
19 import eu
.etaxonomy
.taxeditor
.ui
.dialog
.selection
.DerivedUnitSelectionDialog
;
20 import eu
.etaxonomy
.taxeditor
.ui
.element
.CdmFormFactory
;
21 import eu
.etaxonomy
.taxeditor
.ui
.element
.ICdmFormElement
;
22 import eu
.etaxonomy
.taxeditor
.ui
.section
.AbstractEntityCollectionSection
;
25 * <p>DescribedSpecimenSection class.</p>
28 * @created Sep 16, 2010
31 public class DescribedSpecimenSection
extends AbstractEntityCollectionSection
<TaxonDescription
, SpecimenOrObservationBase
> {
34 * <p>Constructor for DescribedSpecimenSection.</p>
36 * @param formFactory a {@link eu.etaxonomy.taxeditor.ui.element.CdmFormFactory} object.
37 * @param conversation a {@link eu.etaxonomy.cdm.api.conversation.ConversationHolder} object.
38 * @param parentElement a {@link eu.etaxonomy.taxeditor.ui.element.ICdmFormElement} object.
41 public DescribedSpecimenSection(CdmFormFactory formFactory
,
42 ConversationHolder conversation
, ICdmFormElement parentElement
,
44 super(formFactory
, conversation
, parentElement
, "Described Specimen", style
);
49 public Collection
<SpecimenOrObservationBase
> getCollection(
50 TaxonDescription entity
) {
51 return entity
.getDescribedSpecimenOrObservations();
56 public SpecimenOrObservationBase
createNewElement() {
57 DerivedUnitBase selection
= DerivedUnitSelectionDialog
.select(getShell(), getConversationHolder(), null);
63 public void addElement(SpecimenOrObservationBase element
) {
64 getEntity().addDescribedSpecimenOrObservation(element
);
69 public void removeElement(SpecimenOrObservationBase element
) {
70 getEntity().removeDescribedSpecimenOrObservation(element
);
75 public String
getEmptyString() {
76 return "No described specimen yet.";
81 protected String
getTooltipString() {
82 return "Add a described specimen.";