2 * Copyright (C) 2007 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.
10 package eu
.etaxonomy
.taxeditor
.ui
.section
.description
;
12 import java
.util
.Collection
;
13 import java
.util
.Comparator
;
15 import eu
.etaxonomy
.cdm
.api
.conversation
.ConversationHolder
;
16 import eu
.etaxonomy
.cdm
.model
.term
.DefinedTerm
;
17 import eu
.etaxonomy
.cdm
.model
.description
.IModifiable
;
18 import eu
.etaxonomy
.taxeditor
.ui
.element
.CdmFormFactory
;
19 import eu
.etaxonomy
.taxeditor
.ui
.element
.ICdmFormElement
;
20 import eu
.etaxonomy
.taxeditor
.ui
.section
.DefaultCdmBaseComparator
;
21 import eu
.etaxonomy
.taxeditor
.ui
.section
.occurrence
.dna
.AbstractUnboundEntityCollectionSection
;
24 * <p>ModifierSection class.</p>
27 * @created Sep 15, 2010
30 public class ModifierSection
extends AbstractUnboundEntityCollectionSection
<IModifiable
, DefinedTerm
> {
33 * <p>Constructor for ModifierSection.</p>
35 * @param formFactory a {@link eu.etaxonomy.taxeditor.ui.element.CdmFormFactory} object.
36 * @param conversation a {@link eu.etaxonomy.cdm.api.conversation.ConversationHolder} object.
37 * @param parentElement a {@link eu.etaxonomy.taxeditor.ui.element.ICdmFormElement} object.
40 public ModifierSection(CdmFormFactory formFactory
,
41 ConversationHolder conversation
, ICdmFormElement parentElement
,
43 super(formFactory
, conversation
, parentElement
, "Modifiers", style
);
48 public DefinedTerm
createNewElement() {
54 public void addElement(DefinedTerm element
) {
55 getEntity().addModifier(element
);
60 public void removeElement(DefinedTerm element
) {
61 getEntity().removeModifier(element
);
66 public String
getEmptyString() {
67 return "No modifiers yet.";
72 protected String
getTooltipString() {
73 return "Add a modifier.";
77 * @see eu.etaxonomy.taxeditor.ui.section.occurrence.dna.AbstractUnboundEntityCollectionSection#getEntityCollection(java.lang.Object)
80 protected Collection
<DefinedTerm
> getEntityCollection(IModifiable entity
) {
81 return entity
.getModifiers();
85 public Comparator
<DefinedTerm
> getComparator() {
86 return new DefaultCdmBaseComparator
<>();
93 public DefinedTerm
addExisting() {
101 public boolean allowAddExisting() {