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
;
14 import eu
.etaxonomy
.cdm
.api
.conversation
.ConversationHolder
;
15 import eu
.etaxonomy
.cdm
.model
.common
.DefinedTerm
;
16 import eu
.etaxonomy
.cdm
.model
.description
.IModifiable
;
17 import eu
.etaxonomy
.taxeditor
.ui
.element
.CdmFormFactory
;
18 import eu
.etaxonomy
.taxeditor
.ui
.element
.ICdmFormElement
;
19 import eu
.etaxonomy
.taxeditor
.ui
.section
.occurrence
.dna
.AbstractUnboundEntityCollectionSection
;
22 * <p>ModifierSection class.</p>
25 * @created Sep 15, 2010
28 public class ModifierSection
extends AbstractUnboundEntityCollectionSection
<IModifiable
, DefinedTerm
> {
31 * <p>Constructor for ModifierSection.</p>
33 * @param formFactory a {@link eu.etaxonomy.taxeditor.ui.element.CdmFormFactory} object.
34 * @param conversation a {@link eu.etaxonomy.cdm.api.conversation.ConversationHolder} object.
35 * @param parentElement a {@link eu.etaxonomy.taxeditor.ui.element.ICdmFormElement} object.
38 public ModifierSection(CdmFormFactory formFactory
,
39 ConversationHolder conversation
, ICdmFormElement parentElement
,
41 super(formFactory
, conversation
, parentElement
, "Modifiers", style
);
46 public DefinedTerm
createNewElement() {
52 public void addElement(DefinedTerm element
) {
53 getEntity().addModifier(element
);
58 public void removeElement(DefinedTerm element
) {
59 getEntity().removeModifier(element
);
64 public String
getEmptyString() {
65 return "No modifiers yet.";
70 protected String
getTooltipString() {
71 return "Add a modifier.";
75 * @see eu.etaxonomy.taxeditor.ui.section.occurrence.dna.AbstractUnboundEntityCollectionSection#getEntityCollection(java.lang.Object)
78 protected Collection
<DefinedTerm
> getEntityCollection(IModifiable entity
) {
79 return entity
.getModifiers();
86 public DefinedTerm
addExisting() {
94 public boolean allowAddExisting() {