-// $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.
*/
package eu.etaxonomy.taxeditor.ui.section.description;
import java.util.Collection;
+import java.util.Comparator;
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.term.DefinedTerm;
import eu.etaxonomy.cdm.model.description.IModifiable;
-import eu.etaxonomy.taxeditor.ui.campanula.compatibility.ICdmFormElement;
import eu.etaxonomy.taxeditor.ui.element.CdmFormFactory;
-import eu.etaxonomy.taxeditor.ui.section.AbstractEntityCollectionSection;
+import eu.etaxonomy.taxeditor.ui.element.ICdmFormElement;
+import eu.etaxonomy.taxeditor.ui.section.DefaultCdmBaseComparator;
+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, DefinedTerm> {
+public class ModifierSection extends AbstractUnboundEntityCollectionSection<IModifiable, DefinedTerm> {
/**
* <p>Constructor for ModifierSection.</p>
int style) {
super(formFactory, conversation, parentElement, "Modifiers", style);
}
-
- /** {@inheritDoc} */
- @Override
- public Collection<DefinedTerm> getCollection(IModifiable entity) {
- return entity.getModifiers();
- }
/** {@inheritDoc} */
@Override
- public DefinedTerm createNewElement() {
- return DefinedTerm.NewInstance(TermType.Modifier,"","Untitled","");
+ public DefinedTerm createNewElement() {
+ return null;
}
/** {@inheritDoc} */
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();
+ }
+
+ @Override
+ public Comparator<DefinedTerm> getComparator() {
+ return new DefaultCdmBaseComparator<>();
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ @Override
+ public DefinedTerm addExisting() {
+ return null;
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ @Override
+ public boolean allowAddExisting() {
+ return false;
+ }
}