As requested by #1846#comment:4
authorn.hoffmann <n.hoffmann@localhost>
Thu, 10 Feb 2011 16:07:48 +0000 (16:07 +0000)
committern.hoffmann <n.hoffmann@localhost>
Thu, 10 Feb 2011 16:07:48 +0000 (16:07 +0000)
taxeditor-editor/src/main/java/eu/etaxonomy/taxeditor/section/description/DescriptionSourceSection.java

index 4f2d8b8d2669063ba82771cbbedbf5c2512a4309..c5c23f5c98880a084773eb2c9e8de0fac465c6e0 100644 (file)
@@ -13,9 +13,8 @@ package eu.etaxonomy.taxeditor.section.description;
 import java.util.Collection;
 
 import eu.etaxonomy.cdm.api.conversation.ConversationHolder;
+import eu.etaxonomy.cdm.model.common.IdentifiableSource;
 import eu.etaxonomy.cdm.model.description.DescriptionBase;
-import eu.etaxonomy.cdm.model.reference.Reference;
-import eu.etaxonomy.cdm.model.reference.ReferenceFactory;
 import eu.etaxonomy.taxeditor.forms.CdmFormFactory;
 import eu.etaxonomy.taxeditor.forms.ICdmFormElement;
 import eu.etaxonomy.taxeditor.section.AbstractEntityCollectionSection;
@@ -28,7 +27,7 @@ import eu.etaxonomy.taxeditor.section.AbstractEntityCollectionSection;
  * @version 1.0
  */
 public class DescriptionSourceSection extends
-               AbstractEntityCollectionSection<DescriptionBase, Reference>{
+               AbstractEntityCollectionSection<DescriptionBase, IdentifiableSource>{
        
        /**
         * <p>Constructor for DescriptionSourceSection.</p>
@@ -47,20 +46,20 @@ public class DescriptionSourceSection extends
 
        /** {@inheritDoc} */
        @Override
-       public void addElement(Reference element) {
-               getEntity().addDescriptionSource(element);
+       public void addElement(IdentifiableSource element) {
+               getEntity().addSource(element);
        }
 
        /** {@inheritDoc} */
        @Override
-       public Reference createNewElement() {
-               return new ReferenceFactory().newGeneric();
+       public IdentifiableSource createNewElement() {
+               return IdentifiableSource.NewInstance();
        }
 
        /** {@inheritDoc} */
        @Override
-       public Collection<Reference> getCollection(DescriptionBase entity) {
-               return entity.getDescriptionSources();
+       public Collection<IdentifiableSource> getCollection(DescriptionBase entity) {
+               return entity.getSources();
        }
 
        /** {@inheritDoc} */
@@ -77,7 +76,7 @@ public class DescriptionSourceSection extends
 
        /** {@inheritDoc} */
        @Override
-       public void removeElement(Reference element) {
-               getEntity().removeDescriptionSource(element);
+       public void removeElement(IdentifiableSource element) {
+               getEntity().removeSource(element);
        }
 }