// $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.description.Scope;
+import eu.etaxonomy.cdm.model.common.DefinedTerm;
+import eu.etaxonomy.cdm.model.common.TermType;
import eu.etaxonomy.cdm.model.description.TaxonDescription;
import eu.etaxonomy.taxeditor.ui.element.CdmFormFactory;
import eu.etaxonomy.taxeditor.ui.element.ICdmFormElement;
-import eu.etaxonomy.taxeditor.ui.section.AbstractEntityCollectionSection;
+import eu.etaxonomy.taxeditor.ui.section.occurrence.dna.AbstractUnboundEntityCollectionSection;
/**
* <p>ScopeSection class.</p>
* @created Mar 18, 2010
* @version 1.0
*/
-public class ScopeSection extends AbstractEntityCollectionSection<TaxonDescription, Scope> {
+public class ScopeSection extends AbstractUnboundEntityCollectionSection<TaxonDescription, DefinedTerm> {
/**
* <p>Constructor for ScopeSection.</p>
public ScopeSection(CdmFormFactory cdmFormFactory, ConversationHolder conversation, ICdmFormElement parentElement, int style) {
super(cdmFormFactory, conversation, parentElement, "Scope", style);
}
-
- /** {@inheritDoc} */
- @Override
- public void addElement(Scope element) {
- getEntity().addScope(element);
- }
/** {@inheritDoc} */
@Override
- public Scope createNewElement() {
- return Scope.NewInstance();
+ public void addElement(DefinedTerm element) {
+ getEntity().addScope(element);
}
/** {@inheritDoc} */
@Override
- public Collection<Scope> getCollection(TaxonDescription entity) {
- return entity.getScopes();
+ public DefinedTerm createNewElement() {
+ return DefinedTerm.NewInstance(TermType.Scope,"","","");
}
/** {@inheritDoc} */
/** {@inheritDoc} */
@Override
- public void removeElement(Scope element) {
+ public void removeElement(DefinedTerm element) {
getEntity().removeScope(element);
}
+
+ /* (non-Javadoc)
+ * @see eu.etaxonomy.taxeditor.ui.section.occurrence.dna.AbstractUnboundEntityCollectionSection#getEntityCollection(java.lang.Object)
+ */
+ @Override
+ protected Collection<DefinedTerm> getEntityCollection(TaxonDescription entity) {
+ return entity.getScopes();
+ }
}