Merge branch 'develop' into LibrAlign
[taxeditor.git] / eu.etaxonomy.taxeditor.store / src / main / java / eu / etaxonomy / taxeditor / ui / section / vocabulary / RecommendedModifierVocabulariesCollectionSection.java
1 /**
2 * Copyright (C) 2015 EDIT
3 * European Distributed Institute of Taxonomy
4 * http://www.e-taxonomy.eu
5 *
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.
8 */
9 package eu.etaxonomy.taxeditor.ui.section.vocabulary;
10
11 import java.util.Collection;
12
13 import eu.etaxonomy.cdm.api.conversation.ConversationHolder;
14 import eu.etaxonomy.cdm.model.common.DefinedTerm;
15 import eu.etaxonomy.cdm.model.common.TermType;
16 import eu.etaxonomy.cdm.model.common.TermVocabulary;
17 import eu.etaxonomy.cdm.model.description.Feature;
18 import eu.etaxonomy.taxeditor.ui.element.CdmFormFactory;
19 import eu.etaxonomy.taxeditor.ui.element.ICdmFormElement;
20 import eu.etaxonomy.taxeditor.ui.section.occurrence.dna.AbstractUnboundEntityCollectionSection;
21
22 /**
23 * @author pplitzner
24 * @date Apr 27, 2015
25 *
26 */
27 public class RecommendedModifierVocabulariesCollectionSection extends AbstractUnboundEntityCollectionSection<Feature, TermVocabulary<DefinedTerm>> {
28
29 public RecommendedModifierVocabulariesCollectionSection(CdmFormFactory formFactory,
30 ConversationHolder conversation, ICdmFormElement parentElement, int style) {
31 super(formFactory, conversation, parentElement, "Recommended modifier vocabularies", style);
32 }
33
34 /* (non-Javadoc)
35 * @see eu.etaxonomy.taxeditor.ui.section.occurrence.dna.AbstractNullEntityCollectionSection#getEntityCollection(java.lang.Object)
36 */
37 /** {@inheritDoc} */
38 @Override
39 protected Collection<TermVocabulary<DefinedTerm>> getEntityCollection(Feature entity) {
40 return entity.getRecommendedModifierEnumeration();
41 }
42
43 /* (non-Javadoc)
44 * @see eu.etaxonomy.taxeditor.ui.section.AbstractEntityCollectionSection#createNewElement()
45 */
46 /** {@inheritDoc} */
47 @Override
48 public TermVocabulary<DefinedTerm> createNewElement() {
49 return TermVocabulary.NewInstance(TermType.Modifier);
50 }
51
52 /* (non-Javadoc)
53 * @see eu.etaxonomy.taxeditor.section.AbstractEntityCollectionSection#addElement(eu.etaxonomy.cdm.model.common.IVersionableEntity)
54 */
55 /** {@inheritDoc} */
56 @Override
57 public void addElement(TermVocabulary<DefinedTerm> element) {
58 //never gets called
59 }
60
61 /* (non-Javadoc)
62 * @see eu.etaxonomy.taxeditor.section.AbstractEntityCollectionSection#removeElement(eu.etaxonomy.cdm.model.common.IVersionableEntity)
63 */
64 /** {@inheritDoc} */
65 @Override
66 public void removeElement(TermVocabulary<DefinedTerm> element) {
67 getEntity().removeRecommendedModifierEnumeration(element);
68 }
69
70 /* (non-Javadoc)
71 * @see eu.etaxonomy.taxeditor.section.AbstractEntityCollectionSection#getEmptyString()
72 */
73 /** {@inheritDoc} */
74 @Override
75 public String getEmptyString() {
76 return "No modifiers vocabularies yet.";
77 }
78
79 /* (non-Javadoc)
80 * @see eu.etaxonomy.taxeditor.section.AbstractEntityCollectionSection#getTooltipString()
81 */
82 /** {@inheritDoc} */
83 @Override
84 protected String getTooltipString() {
85 return "Add a modifier vocabulary";
86 }
87
88 /**
89 * {@inheritDoc}
90 */
91 @Override
92 public TermVocabulary<DefinedTerm> addExisting() {
93 // TODO Auto-generated method stub
94 return null;
95 }
96
97 /**
98 * {@inheritDoc}
99 */
100 @Override
101 public boolean allowAddExisting() {
102 // TODO Auto-generated method stub
103 return false;
104 }
105
106
107 }