1
|
// $Id$
|
2
|
/**
|
3
|
* Copyright (C) 2015 EDIT
|
4
|
* European Distributed Institute of Taxonomy
|
5
|
* http://www.e-taxonomy.eu
|
6
|
*
|
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.
|
9
|
*/
|
10
|
package eu.etaxonomy.taxeditor.ui.section.vocabulary;
|
11
|
|
12
|
import java.util.Collection;
|
13
|
|
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.occurrence.dna.AbstractUnboundEntityCollectionSection;
|
22
|
|
23
|
/**
|
24
|
* @author pplitzner
|
25
|
* @date Apr 27, 2015
|
26
|
*
|
27
|
*/
|
28
|
public class RecommendedModifierVocabulariesCollectionSection extends AbstractUnboundEntityCollectionSection<Feature, TermVocabulary<DefinedTerm>> {
|
29
|
|
30
|
public RecommendedModifierVocabulariesCollectionSection(CdmFormFactory formFactory,
|
31
|
ConversationHolder conversation, ICdmFormElement parentElement, int style) {
|
32
|
super(formFactory, conversation, parentElement, "Recommended modifier vocabularies", style);
|
33
|
}
|
34
|
|
35
|
/* (non-Javadoc)
|
36
|
* @see eu.etaxonomy.taxeditor.ui.section.occurrence.dna.AbstractNullEntityCollectionSection#getEntityCollection(java.lang.Object)
|
37
|
*/
|
38
|
/** {@inheritDoc} */
|
39
|
@Override
|
40
|
protected Collection<TermVocabulary<DefinedTerm>> getEntityCollection(Feature entity) {
|
41
|
return entity.getRecommendedModifierEnumeration();
|
42
|
}
|
43
|
|
44
|
/* (non-Javadoc)
|
45
|
* @see eu.etaxonomy.taxeditor.ui.section.AbstractEntityCollectionSection#createNewElement()
|
46
|
*/
|
47
|
/** {@inheritDoc} */
|
48
|
@Override
|
49
|
public TermVocabulary<DefinedTerm> createNewElement() {
|
50
|
return TermVocabulary.NewInstance(TermType.Modifier);
|
51
|
}
|
52
|
|
53
|
/* (non-Javadoc)
|
54
|
* @see eu.etaxonomy.taxeditor.section.AbstractEntityCollectionSection#addElement(eu.etaxonomy.cdm.model.common.IVersionableEntity)
|
55
|
*/
|
56
|
/** {@inheritDoc} */
|
57
|
@Override
|
58
|
public void addElement(TermVocabulary<DefinedTerm> element) {
|
59
|
//never gets called
|
60
|
}
|
61
|
|
62
|
/* (non-Javadoc)
|
63
|
* @see eu.etaxonomy.taxeditor.section.AbstractEntityCollectionSection#removeElement(eu.etaxonomy.cdm.model.common.IVersionableEntity)
|
64
|
*/
|
65
|
/** {@inheritDoc} */
|
66
|
@Override
|
67
|
public void removeElement(TermVocabulary<DefinedTerm> element) {
|
68
|
getEntity().removeRecommendedModifierEnumeration(element);
|
69
|
}
|
70
|
|
71
|
/* (non-Javadoc)
|
72
|
* @see eu.etaxonomy.taxeditor.section.AbstractEntityCollectionSection#getEmptyString()
|
73
|
*/
|
74
|
/** {@inheritDoc} */
|
75
|
@Override
|
76
|
public String getEmptyString() {
|
77
|
return "No modifiers vocabularies yet.";
|
78
|
}
|
79
|
|
80
|
/* (non-Javadoc)
|
81
|
* @see eu.etaxonomy.taxeditor.section.AbstractEntityCollectionSection#getTooltipString()
|
82
|
*/
|
83
|
/** {@inheritDoc} */
|
84
|
@Override
|
85
|
protected String getTooltipString() {
|
86
|
return "Add a modifier vocabulary";
|
87
|
}
|
88
|
|
89
|
|
90
|
}
|