// $Id$
/**
* Copyright (C) 2007 EDIT
-* European Distributed Institute of Taxonomy
+* European Distributed Institute of Taxonomy
* http://www.e-taxonomy.eu
-*
+*
* The contents of this file are subject to the Mozilla Public License Version 1.1
* See LICENSE.TXT at the top of this package for the full license terms.
*/
import java.util.Collection;
import eu.etaxonomy.cdm.api.conversation.ConversationHolder;
+import eu.etaxonomy.cdm.model.common.DefinedTerm;
+import eu.etaxonomy.cdm.model.common.TermType;
import eu.etaxonomy.cdm.model.description.IModifiable;
-import eu.etaxonomy.cdm.model.description.Modifier;
import eu.etaxonomy.taxeditor.ui.element.CdmFormFactory;
-import eu.etaxonomy.taxeditor.ui.section.AbstractEntityCollectionSection;
-import eu.etaxonomy.taxeditor.ui.section.campanula.compatibility.ICdmFormElement;
+import eu.etaxonomy.taxeditor.ui.element.ICdmFormElement;
+import eu.etaxonomy.taxeditor.ui.section.occurrence.dna.AbstractUnboundEntityCollectionSection;
/**
* <p>ModifierSection class.</p>
* @created Sep 15, 2010
* @version 1.0
*/
-public class ModifierSection extends AbstractEntityCollectionSection<IModifiable, Modifier> {
+public class ModifierSection extends AbstractUnboundEntityCollectionSection<IModifiable, DefinedTerm> {
/**
* <p>Constructor for ModifierSection.</p>
int style) {
super(formFactory, conversation, parentElement, "Modifiers", style);
}
-
- /** {@inheritDoc} */
- @Override
- public Collection<Modifier> getCollection(IModifiable entity) {
- return entity.getModifiers();
- }
/** {@inheritDoc} */
@Override
- public Modifier createNewElement() {
- return Modifier.NewInstance();
+ public DefinedTerm createNewElement() {
+ return DefinedTerm.NewInstance(TermType.Modifier,"","Untitled","");
}
/** {@inheritDoc} */
@Override
- public void addElement(Modifier element) {
+ public void addElement(DefinedTerm element) {
getEntity().addModifier(element);
}
/** {@inheritDoc} */
@Override
- public void removeElement(Modifier element) {
+ public void removeElement(DefinedTerm element) {
getEntity().removeModifier(element);
}
protected String getTooltipString() {
return "Add a modifier.";
}
+
+ /* (non-Javadoc)
+ * @see eu.etaxonomy.taxeditor.ui.section.occurrence.dna.AbstractUnboundEntityCollectionSection#getEntityCollection(java.lang.Object)
+ */
+ @Override
+ protected Collection<DefinedTerm> getEntityCollection(IModifiable entity) {
+ return entity.getModifiers();
+ }
}