3 * Copyright (C) 2015 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.
10 package eu
.etaxonomy
.taxeditor
.ui
.section
.vocabulary
;
12 import java
.util
.Collection
;
14 import eu
.etaxonomy
.cdm
.api
.conversation
.ConversationHolder
;
15 import eu
.etaxonomy
.cdm
.model
.description
.Feature
;
16 import eu
.etaxonomy
.cdm
.model
.description
.MeasurementUnit
;
17 import eu
.etaxonomy
.taxeditor
.ui
.element
.CdmFormFactory
;
18 import eu
.etaxonomy
.taxeditor
.ui
.element
.ICdmFormElement
;
19 import eu
.etaxonomy
.taxeditor
.ui
.section
.occurrence
.dna
.AbstractUnboundEntityCollectionSection
;
26 public class MeasurementUnitCollectionSection
extends AbstractUnboundEntityCollectionSection
<Feature
, MeasurementUnit
> {
28 public MeasurementUnitCollectionSection(CdmFormFactory formFactory
,
29 ConversationHolder conversation
, ICdmFormElement parentElement
, int style
) {
30 super(formFactory
, conversation
, parentElement
, "Recommended measurement units", style
);
34 * @see eu.etaxonomy.taxeditor.ui.section.occurrence.dna.AbstractNullEntityCollectionSection#getEntityCollection(java.lang.Object)
38 protected Collection
<MeasurementUnit
> getEntityCollection(Feature entity
) {
39 return entity
.getRecommendedMeasurementUnits();
43 * @see eu.etaxonomy.taxeditor.ui.section.AbstractEntityCollectionSection#createNewElement()
47 public MeasurementUnit
createNewElement() {
48 return MeasurementUnit
.NewInstance();
52 * @see eu.etaxonomy.taxeditor.section.AbstractEntityCollectionSection#addElement(eu.etaxonomy.cdm.model.common.IVersionableEntity)
56 public void addElement(MeasurementUnit element
) {
61 * @see eu.etaxonomy.taxeditor.section.AbstractEntityCollectionSection#removeElement(eu.etaxonomy.cdm.model.common.IVersionableEntity)
65 public void removeElement(MeasurementUnit element
) {
66 getEntity().removeRecommendedMeasurementUnit(element
);
70 * @see eu.etaxonomy.taxeditor.section.AbstractEntityCollectionSection#getEmptyString()
74 public String
getEmptyString() {
75 return "No recommended measurement units yet.";
79 * @see eu.etaxonomy.taxeditor.section.AbstractEntityCollectionSection#getTooltipString()
83 protected String
getTooltipString() {
84 return "Add a measurement unit";