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
;
12 import java
.util
.Comparator
;
14 import eu
.etaxonomy
.cdm
.api
.conversation
.ConversationHolder
;
15 import eu
.etaxonomy
.cdm
.model
.common
.DefinedTerm
;
16 import eu
.etaxonomy
.cdm
.model
.common
.TermType
;
17 import eu
.etaxonomy
.cdm
.model
.common
.TermVocabulary
;
18 import eu
.etaxonomy
.cdm
.model
.description
.Feature
;
19 import eu
.etaxonomy
.taxeditor
.ui
.element
.CdmFormFactory
;
20 import eu
.etaxonomy
.taxeditor
.ui
.element
.ICdmFormElement
;
21 import eu
.etaxonomy
.taxeditor
.ui
.section
.DefaultCdmBaseComparator
;
22 import eu
.etaxonomy
.taxeditor
.ui
.section
.occurrence
.dna
.AbstractUnboundEntityCollectionSection
;
29 public class RecommendedModifierVocabulariesCollectionSection
extends AbstractUnboundEntityCollectionSection
<Feature
, TermVocabulary
<DefinedTerm
>> {
31 public RecommendedModifierVocabulariesCollectionSection(CdmFormFactory formFactory
,
32 ConversationHolder conversation
, ICdmFormElement parentElement
, int style
) {
33 super(formFactory
, conversation
, parentElement
, "Recommended modifier vocabularies", style
);
37 * @see eu.etaxonomy.taxeditor.ui.section.occurrence.dna.AbstractNullEntityCollectionSection#getEntityCollection(java.lang.Object)
41 protected Collection
<TermVocabulary
<DefinedTerm
>> getEntityCollection(Feature entity
) {
42 return entity
.getRecommendedModifierEnumeration();
46 public Comparator
<TermVocabulary
<DefinedTerm
>> getComparator() {
47 return new DefaultCdmBaseComparator
<>();
51 * @see eu.etaxonomy.taxeditor.ui.section.AbstractEntityCollectionSection#createNewElement()
55 public TermVocabulary
<DefinedTerm
> createNewElement() {
56 return TermVocabulary
.NewInstance(TermType
.Modifier
);
60 * @see eu.etaxonomy.taxeditor.section.AbstractEntityCollectionSection#addElement(eu.etaxonomy.cdm.model.common.IVersionableEntity)
64 public void addElement(TermVocabulary
<DefinedTerm
> element
) {
69 * @see eu.etaxonomy.taxeditor.section.AbstractEntityCollectionSection#removeElement(eu.etaxonomy.cdm.model.common.IVersionableEntity)
73 public void removeElement(TermVocabulary
<DefinedTerm
> element
) {
74 getEntity().removeRecommendedModifierEnumeration(element
);
78 * @see eu.etaxonomy.taxeditor.section.AbstractEntityCollectionSection#getEmptyString()
82 public String
getEmptyString() {
83 return "No modifiers vocabularies yet.";
87 * @see eu.etaxonomy.taxeditor.section.AbstractEntityCollectionSection#getTooltipString()
91 protected String
getTooltipString() {
92 return "Add a modifier vocabulary";
99 public TermVocabulary
<DefinedTerm
> addExisting() {
100 // TODO Auto-generated method stub
108 public boolean allowAddExisting() {
109 // TODO Auto-generated method stub