2 * Copyright (C) 2015 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.
9 package eu
.etaxonomy
.taxeditor
.ui
.section
.vocabulary
;
11 import java
.util
.Collection
;
13 import eu
.etaxonomy
.cdm
.api
.conversation
.ConversationHolder
;
14 import eu
.etaxonomy
.cdm
.model
.description
.Feature
;
15 import eu
.etaxonomy
.cdm
.model
.description
.MeasurementUnit
;
16 import eu
.etaxonomy
.taxeditor
.ui
.element
.CdmFormFactory
;
17 import eu
.etaxonomy
.taxeditor
.ui
.element
.ICdmFormElement
;
18 import eu
.etaxonomy
.taxeditor
.ui
.section
.occurrence
.dna
.AbstractUnboundEntityCollectionSection
;
25 public class MeasurementUnitCollectionSection
extends AbstractUnboundEntityCollectionSection
<Feature
, MeasurementUnit
> {
27 public MeasurementUnitCollectionSection(CdmFormFactory formFactory
,
28 ConversationHolder conversation
, ICdmFormElement parentElement
, int style
) {
29 super(formFactory
, conversation
, parentElement
, "Recommended measurement units", style
);
33 * @see eu.etaxonomy.taxeditor.ui.section.occurrence.dna.AbstractNullEntityCollectionSection#getEntityCollection(java.lang.Object)
37 protected Collection
<MeasurementUnit
> getEntityCollection(Feature entity
) {
38 return entity
.getRecommendedMeasurementUnits();
42 * @see eu.etaxonomy.taxeditor.ui.section.AbstractEntityCollectionSection#createNewElement()
46 public MeasurementUnit
createNewElement() {
47 return MeasurementUnit
.NewInstance();
51 * @see eu.etaxonomy.taxeditor.section.AbstractEntityCollectionSection#addElement(eu.etaxonomy.cdm.model.common.IVersionableEntity)
55 public void addElement(MeasurementUnit element
) {
60 * @see eu.etaxonomy.taxeditor.section.AbstractEntityCollectionSection#removeElement(eu.etaxonomy.cdm.model.common.IVersionableEntity)
64 public void removeElement(MeasurementUnit element
) {
65 getEntity().removeRecommendedMeasurementUnit(element
);
69 * @see eu.etaxonomy.taxeditor.section.AbstractEntityCollectionSection#getEmptyString()
73 public String
getEmptyString() {
74 return "No recommended measurement units yet.";
78 * @see eu.etaxonomy.taxeditor.section.AbstractEntityCollectionSection#getTooltipString()
82 protected String
getTooltipString() {
83 return "Add a measurement unit";
90 public MeasurementUnit
addExisting() {
91 // TODO Auto-generated method stub
99 public boolean allowAddExisting() {
100 // TODO Auto-generated method stub