ref #6333 Add generic support for entity collection sections to allow
authorPatrick Plitzner <p.plitzner@bgbm.org>
Wed, 18 Jan 2017 08:16:01 +0000 (09:16 +0100)
committerPatrick Plitzner <p.plitzner@bgbm.org>
Wed, 18 Jan 2017 08:16:01 +0000 (09:16 +0100)
adding existing entities

 - this is done by two abstract methods allowAddExisting() and
addExisting()

55 files changed:
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/ui/dialog/selection/SelectionDialogFactory.java
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/ui/section/AbstractEntityCollectionElement.java
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/ui/section/AbstractEntityCollectionSection.java
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/ui/section/agent/TeamMemberSection.java
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/ui/section/classification/TaxonNodeAgentRelationCollectionSection.java
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/ui/section/description/DescribedSpecimenSection.java
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/ui/section/description/DescriptionElementMediaSection.java
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/ui/section/description/DescriptionElementSourceSection.java
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/ui/section/description/DescriptionSourceSection.java
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/ui/section/description/GeoScopeSection.java
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/ui/section/description/ModifierSection.java
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/ui/section/description/ScopeSection.java
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/ui/section/description/StateDataSection.java
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/ui/section/description/StatisticalMeasurementValueSection.java
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/ui/section/grantedAuthority/GrantedAuthorityDetailSection.java
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/ui/section/group/MemberDetailSection.java
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/ui/section/key/ScopeRestrictionSection.java
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/ui/section/key/TaxonomicScopeSection.java
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/ui/section/media/MediaRepresentationPartSection.java
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/ui/section/media/MediaRepresentationSection.java
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/ui/section/media/MediaSection.java
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/ui/section/name/NameRelationshipDetailSection.java
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/ui/section/name/NomenclaturalStatusSection.java
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/ui/section/name/NonViralNameDetailSection.java
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/ui/section/name/ProtologueSection.java
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/ui/section/name/TypeDesignationSection.java
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/ui/section/occurrence/CollectingAreasDetailSection.java
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/ui/section/occurrence/CurrentDeterminationDetailSection.java
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/ui/section/occurrence/DeterminationHistoryDetailSection.java
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/ui/section/occurrence/GeoScopeDetailSection.java
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/ui/section/occurrence/GeoScopePolyKeyDetailSection.java
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/ui/section/occurrence/SourceCollectionDetailSection.java
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/ui/section/occurrence/SpecimenCollectionDetailSection.java
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/ui/section/occurrence/association/DerivedUnitTypeDesignationSection.java
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/ui/section/occurrence/derivedUnit/PreservedSpecimenCurrentDeterminationDetailSection.java
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/ui/section/occurrence/derivedUnit/PreservedSpecimenSourceCollectionDetailSection.java
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/ui/section/occurrence/dna/AmplificationGelPhotoCollectionDetailSection.java
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/ui/section/occurrence/dna/CurrentSampleDesignationDetailSection.java
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/ui/section/occurrence/dna/SampleDesignationHistoryDetailSection.java
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/ui/section/occurrence/dna/SequenceContigFileCollectionDetailSection.java
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/ui/section/occurrence/dna/SequenceReferenceCollectionDetailSection.java
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/ui/section/occurrence/dna/SingleReadPherogramCollectionDetailSection.java
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/ui/section/supplemental/AnnotationSection.java
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/ui/section/supplemental/CreditSection.java
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/ui/section/supplemental/ExtensionSection.java
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/ui/section/supplemental/MarkerSection.java
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/ui/section/supplemental/RightsSection.java
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/ui/section/supplemental/SourceSection.java
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/ui/section/supplemental/identifier/DerivedUnitFacadeIdentifierSection.java
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/ui/section/supplemental/identifier/IdentifierSection.java
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/ui/section/user/GroupsByUserDetailSection.java
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/ui/section/vocabulary/MeasurementUnitCollectionSection.java
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/ui/section/vocabulary/RecommendedModifierVocabulariesCollectionSection.java
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/ui/section/vocabulary/StateVocabularyCollectionSection.java
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/ui/section/vocabulary/StatisticalMeasureCollectionSection.java

index c47fa2925f8fad9d8c10d94776648c5cd33527a2..dbb9ef191ff0f779af69632c8cbd3e063a63ab30 100644 (file)
@@ -27,6 +27,7 @@ import eu.etaxonomy.cdm.model.description.PolytomousKey;
 import eu.etaxonomy.cdm.model.description.PolytomousKeyNode;
 import eu.etaxonomy.cdm.model.location.Country;
 import eu.etaxonomy.cdm.model.location.NamedArea;
+import eu.etaxonomy.cdm.model.media.Media;
 import eu.etaxonomy.cdm.model.molecular.Amplification;
 import eu.etaxonomy.cdm.model.molecular.Primer;
 import eu.etaxonomy.cdm.model.name.TaxonNameBase;
@@ -81,7 +82,7 @@ public class SelectionDialogFactory {
                if(clazz.equals(Reference.class)){
                        return (T) ReferenceSelectionDialog.select(shell, conversation, (Reference) currentSelection);
                }
-               
+
                if(clazz.equals(TaxonNameBase.class)){
                        return (T) NameSelectionDialog.select(shell, conversation, (TaxonNameBase) currentSelection);
                }
@@ -155,6 +156,9 @@ public class SelectionDialogFactory {
                if(clazz.equals(Amplification.class)){
                    return (T) AmplificationSelectionDialog.select(shell, conversation, (Amplification) currentSelection);
                }
+               if(clazz.equals(Media.class)){
+                   return (T) MediaSelectionDialog.select(shell, conversation, (Media) currentSelection);
+               }
 
                return null;
        }
index 2a32e820560fc1aaf521c5c120cd2b73648e09ce..153a706aa018cb66d04bd70e8d6242a3bda2b78e 100644 (file)
@@ -112,11 +112,9 @@ public abstract class AbstractEntityCollectionElement<ENTITY> extends
                            if(entity!=null){
                                if(getParentElement() instanceof AbstractEntityCollectionSection){
                                    ((AbstractEntityCollectionSection)getParentElement()).removeElement(getEntity());
-                                   setEntity(entity);
                                    ((AbstractEntityCollectionSection)getParentElement()).addElement(entity);
-                                   ((AbstractEntityCollectionSection)getParentElement()).firePropertyChangeEvent(getParentElement());
                                }
-
+                               firePropertyChangeEvent(this);
                            }
                        }
                    });
index 693a54028bdb1c7e4a9849418f9105eabd084cb2..81ece03c26b0f8c3b54ec18729b0a5fe18e92daf 100644 (file)
@@ -85,17 +85,17 @@ public abstract class AbstractEntityCollectionSection<ENTITY, ELEMENT> extends A
        protected Control createToolbar() {
                ToolBarManager toolBarManager = new ToolBarManager(SWT.FLAT);
 
-               Action addAction = new Action("add", IAction.AS_PUSH_BUTTON){
+               Action addAction = new Action("Add", IAction.AS_PUSH_BUTTON){
                        @Override
                        public void run() {
-                               ELEMENT element = createNewElement();
-                               if(element != null){
-                                       addElement(element);
-                                       if(! getSection().isExpanded()) {
-                        getSection().setExpanded(true);
-                    }
-                                       internalUpdateSection(true);
-                               }
+                           ELEMENT element = createNewElement();
+                           if(element != null){
+                               addElement(element);
+                               if(! getSection().isExpanded()) {
+                                   getSection().setExpanded(true);
+                               }
+                               internalUpdateSection(true);
+                           }
                        }
                };
                addAction.setImageDescriptor(new ImageDescriptor() {
@@ -107,7 +107,35 @@ public abstract class AbstractEntityCollectionSection<ENTITY, ELEMENT> extends A
                });
                addAction.setToolTipText(getTooltipString());
 
+               Action browseAction = null;
+               if(allowAddExisting()){
+                   browseAction = new Action("Browse", IAction.AS_PUSH_BUTTON){
+                       @Override
+                       public void run() {
+                           ELEMENT element = addExisting();
+                           if(element != null){
+                               addElement(element);
+                               if(! getSection().isExpanded()) {
+                                   getSection().setExpanded(true);
+                               }
+                               internalUpdateSection(true);
+                           }
+                       }
+                   };
+                   browseAction.setImageDescriptor(new ImageDescriptor() {
+
+                       @Override
+                       public ImageData getImageData() {
+                           return ImageResources.getImage(ImageResources.BROWSE_ICON).getImageData();
+                       }
+                   });
+                   browseAction.setToolTipText("Browse");
+               }
+
                toolBarManager.add(addAction);
+               if(browseAction!=null){
+                   toolBarManager.add(browseAction);
+               }
 
                return toolBarManager.createControl(this);
        }
@@ -313,6 +341,7 @@ public abstract class AbstractEntityCollectionSection<ENTITY, ELEMENT> extends A
         return entityCollectionElement;
     }
 
+
        /**
         * Get the specific collection of this entity
         *
@@ -335,6 +364,23 @@ public abstract class AbstractEntityCollectionSection<ENTITY, ELEMENT> extends A
         */
        public abstract void addElement(ELEMENT element);
 
+       /**
+        * Add an existing element to the entities collection.
+        * @return the existing element
+        */
+       public abstract ELEMENT addExisting();
+
+       /**
+        * If <code>true</code> the section will also display
+        * a browse icon to choose from existing elements.
+        * <br>
+        * <b>Note:</b> when returning true you have to make sure
+        * to implement the {@link #addExisting()} method
+        * @return true if existing entities can be added;
+        * false otherwise
+        */
+       public abstract boolean allowAddExisting();
+
        /**
         * Remove an element from the entities collection
         *
index bc32282de180af6c55f815bfa03fa29ed86faa76..7e64521e4e65ebd6793c31499e538193974e6d74 100644 (file)
@@ -90,5 +90,20 @@ public class TeamMemberSection extends AbstractUnboundEntityCollectionSection<Te
        return isNomenclaturalTeam;
     }
 
+    /**
+     * {@inheritDoc}
+     */
+    @Override
+    public Person addExisting() {
+        return null;
+    }
+
+    /**
+     * {@inheritDoc}
+     */
+    @Override
+    public boolean allowAddExisting() {
+        return false;
+    }
 
 }
index 1a745788dfdd14148db26a4020c0882a1f0616a4..1847f7c25e44b2716ceafcf0ddd96007a9682f88 100644 (file)
@@ -26,13 +26,6 @@ public class TaxonNodeAgentRelationCollectionSection extends AbstractEntityColle
 
 
 
-    /**
-     * @param formFactory
-     * @param conversation
-     * @param parentElement
-
-     * @param style
-     */
     public TaxonNodeAgentRelationCollectionSection (CdmFormFactory formFactory, ConversationHolder conversation,
             ICdmFormElement parentElement, int style) {
         super(formFactory, conversation, parentElement,  "Related persons or teams", style);
@@ -80,4 +73,20 @@ public class TaxonNodeAgentRelationCollectionSection extends AbstractEntityColle
         return false;
     }
 
+    /**
+     * {@inheritDoc}
+     */
+    @Override
+    public TaxonNodeAgentRelation addExisting() {
+        return null;
+    }
+
+    /**
+     * {@inheritDoc}
+     */
+    @Override
+    public boolean allowAddExisting() {
+        return false;
+    }
+
 }
index 36d035f0783cfa519f424b1f2e31a4a4290b5aba..a2651e253d36996022b4d04b7eeaef230d55dbed 100644 (file)
@@ -1,8 +1,8 @@
 /**
 * 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.
 */
@@ -44,24 +44,24 @@ public class DescribedSpecimenSection extends AbstractEntityCollectionSection<Ta
                        int style) {
                super(formFactory, conversation, parentElement, "Described Specimen", style);
        }
-       
+
        /** {@inheritDoc} */
        @Override
        public Collection<SpecimenOrObservationBase> getCollection(
                        TaxonDescription entity) {
-               //FIXME:This class is not really an entity collection section, and should be moved 
+               //FIXME:This class is not really an entity collection section, and should be moved
                // to a single entity section, but one with the possibility of launching a wizard
                List<SpecimenOrObservationBase> collection = new ArrayList<SpecimenOrObservationBase>();
                if(entity.getDescribedSpecimenOrObservation() != null) {
-                       collection.add(entity.getDescribedSpecimenOrObservation());     
-               }               
+                       collection.add(entity.getDescribedSpecimenOrObservation());
+               }
                return collection;
        }
 
        /** {@inheritDoc} */
        @Override
        public SpecimenOrObservationBase createNewElement() {
-               DerivedUnit selection = DerivedUnitSelectionDialog.select(getShell(), getConversationHolder(), null);           
+               DerivedUnit selection = DerivedUnitSelectionDialog.select(getShell(), getConversationHolder(), null);
                return selection;
        }
 
@@ -74,7 +74,7 @@ public class DescribedSpecimenSection extends AbstractEntityCollectionSection<Ta
        /** {@inheritDoc} */
        @Override
        public void removeElement(SpecimenOrObservationBase element) {
-               getEntity().setDescribedSpecimenOrObservation(null);            
+               getEntity().setDescribedSpecimenOrObservation(null);
        }
 
        /** {@inheritDoc} */
@@ -88,4 +88,20 @@ public class DescribedSpecimenSection extends AbstractEntityCollectionSection<Ta
        protected String getTooltipString() {
                return "Add a described specimen.";
        }
+
+    /**
+     * {@inheritDoc}
+     */
+    @Override
+    public SpecimenOrObservationBase addExisting() {
+        return null;
+    }
+
+    /**
+     * {@inheritDoc}
+     */
+    @Override
+    public boolean allowAddExisting() {
+        return false;
+    }
 }
index 3a54e2b1a1247be1cf9e46a84e39a3ae19fa21a0..2f376ca09aa57e9c0b0ea9f121292c687ea72faf 100644 (file)
@@ -79,5 +79,21 @@ public class DescriptionElementMediaSection extends
                getEntity().removeMedia(element);
        }
 
+    /**
+     * {@inheritDoc}
+     */
+    @Override
+    public Media addExisting() {
+        return null;
+    }
+
+    /**
+     * {@inheritDoc}
+     */
+    @Override
+    public boolean allowAddExisting() {
+        return false;
+    }
+
 
 }
index 6c74da87009652102f6c3a523691da51f28c8569..635385c0e53627c1a38bc51c4dae87598657037f 100644 (file)
@@ -87,4 +87,20 @@ public class DescriptionElementSourceSection extends
     public void removeElement(DescriptionElementSource element) {
         getEntity().removeSource(element);
     }
+
+    /**
+     * {@inheritDoc}
+     */
+    @Override
+    public DescriptionElementSource addExisting() {
+        return null;
+    }
+
+    /**
+     * {@inheritDoc}
+     */
+    @Override
+    public boolean allowAddExisting() {
+        return false;
+    }
 }
index 68095f5aa3cee99f5d95497edca171ce801f6a5f..0c508ed334ce333d570a514aef70fbdf8f5db62a 100644 (file)
@@ -1,8 +1,8 @@
 /**
 * 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.
 */
@@ -29,7 +29,7 @@ import eu.etaxonomy.taxeditor.ui.section.AbstractEntityCollectionSection;
  */
 public class DescriptionSourceSection extends
                AbstractEntityCollectionSection<DescriptionBase, IdentifiableSource>{
-       
+
        /**
         * <p>Constructor for DescriptionSourceSection.</p>
         *
@@ -43,7 +43,7 @@ public class DescriptionSourceSection extends
                super(cdmFormFactory, conversation, parentElement, "Description Sources", style);
        }
 
-       
+
 
        /** {@inheritDoc} */
        @Override
@@ -54,7 +54,7 @@ public class DescriptionSourceSection extends
        /** {@inheritDoc} */
        @Override
        public IdentifiableSource createNewElement() {
-               OriginalSourceType ost = OriginalSourceTypeSelectionDialog.select(getShell(), getConversationHolder()); 
+               OriginalSourceType ost = OriginalSourceTypeSelectionDialog.select(getShell(), getConversationHolder());
                if(ost != null) {
                        return IdentifiableSource.NewInstance(ost);
                } else {
@@ -85,4 +85,24 @@ public class DescriptionSourceSection extends
        public void removeElement(IdentifiableSource element) {
                getEntity().removeSource(element);
        }
+
+
+
+    /**
+     * {@inheritDoc}
+     */
+    @Override
+    public IdentifiableSource addExisting() {
+        return null;
+    }
+
+
+
+    /**
+     * {@inheritDoc}
+     */
+    @Override
+    public boolean allowAddExisting() {
+        return false;
+    }
 }
index c293960563cd25850c7cd97564307676d868db1f..ca3dcc277776ac908afeabd929fb7b0a2cf4ac00 100644 (file)
@@ -1,8 +1,8 @@
 /**
 * 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.
 */
@@ -26,7 +26,7 @@ import eu.etaxonomy.taxeditor.ui.section.AbstractEntityCollectionSection;
  * @version 1.0
  */
 public class GeoScopeSection extends AbstractEntityCollectionSection<TaxonDescription, NamedArea> {
-       
+
        /**
         * <p>Constructor for GeoScopeSection.</p>
         *
@@ -39,7 +39,7 @@ public class GeoScopeSection extends AbstractEntityCollectionSection<TaxonDescri
                        ConversationHolder conversation, ICdmFormElement parentElement, int style) {
                super(formFactory, conversation, parentElement, "Geo Scope", style);
        }
-       
+
        /** {@inheritDoc} */
        @Override
        public Collection<NamedArea> getCollection(TaxonDescription entity) {
@@ -75,4 +75,20 @@ public class GeoScopeSection extends AbstractEntityCollectionSection<TaxonDescri
        protected String getTooltipString() {
                return "Add a new geo scope.";
        }
+
+    /**
+     * {@inheritDoc}
+     */
+    @Override
+    public NamedArea addExisting() {
+        return null;
+    }
+
+    /**
+     * {@inheritDoc}
+     */
+    @Override
+    public boolean allowAddExisting() {
+        return false;
+    }
 }
index 00b4fa1ab32c18836e3f5c42271faedd190505c8..b4ad1c9bbe8a2beac26bf542da1723eeaaccb83f 100644 (file)
@@ -79,4 +79,20 @@ public class ModifierSection extends AbstractUnboundEntityCollectionSection<IMod
     protected Collection<DefinedTerm> getEntityCollection(IModifiable entity) {
         return entity.getModifiers();
     }
+
+    /**
+     * {@inheritDoc}
+     */
+    @Override
+    public DefinedTerm addExisting() {
+        return null;
+    }
+
+    /**
+     * {@inheritDoc}
+     */
+    @Override
+    public boolean allowAddExisting() {
+        return false;
+    }
 }
index 7b6b3de4317a8d8bc465b5726591b21e9b0fa329..566f76a2d748ab096b349f4cc7f058786e1c36e2 100644 (file)
@@ -77,4 +77,20 @@ public class ScopeSection extends AbstractUnboundEntityCollectionSection<TaxonDe
     protected Collection<DefinedTerm> getEntityCollection(TaxonDescription entity) {
         return entity.getScopes();
     }
+
+    /**
+     * {@inheritDoc}
+     */
+    @Override
+    public DefinedTerm addExisting() {
+        return null;
+    }
+
+    /**
+     * {@inheritDoc}
+     */
+    @Override
+    public boolean allowAddExisting() {
+        return false;
+    }
 }
index 27838d79027da2602ee69e330a8dffc51cf2ce70..b2b8fcb504cb87121954ad638184263444e031c0 100644 (file)
@@ -1,8 +1,8 @@
 /**
 * 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.
 */
@@ -40,7 +40,7 @@ public class StateDataSection extends AbstractEntityCollectionSection<Categorica
                        int style) {
                super(formFactory, conversation, parentElement, "State Data", style);
        }
-       
+
        /** {@inheritDoc} */
        @Override
        public Collection<StateData> getCollection(CategoricalData entity) {
@@ -77,5 +77,21 @@ public class StateDataSection extends AbstractEntityCollectionSection<Categorica
                return "Create new state data";
        }
 
-       
+    /**
+     * {@inheritDoc}
+     */
+    @Override
+    public StateData addExisting() {
+        return null;
+    }
+
+    /**
+     * {@inheritDoc}
+     */
+    @Override
+    public boolean allowAddExisting() {
+        return false;
+    }
+
+
 }
index 1acaed0060b8ee49c222ea1a25ebcb4040b4c49f..ac7b24aaf0e413284ee6b663e8b03f6a53a21d36 100644 (file)
@@ -1,8 +1,8 @@
 /**
 * 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.
 */
@@ -27,7 +27,7 @@ import eu.etaxonomy.taxeditor.ui.section.AbstractEntityCollectionSection;
  */
 public class StatisticalMeasurementValueSection extends
                AbstractEntityCollectionSection<QuantitativeData, StatisticalMeasurementValue> {
-       
+
        /**
         * <p>Constructor for StatisticalMeasurementValueSection.</p>
         *
@@ -41,7 +41,7 @@ public class StatisticalMeasurementValueSection extends
                        int style) {
                super(formFactory, conversation, parentElement, "Statistical Measurement Value", style);
        }
-       
+
        /** {@inheritDoc} */
        @Override
        public Collection<StatisticalMeasurementValue> getCollection(
@@ -78,4 +78,20 @@ public class StatisticalMeasurementValueSection extends
        protected String getTooltipString() {
                return "Create new statistical value";
        }
+
+    /**
+     * {@inheritDoc}
+     */
+    @Override
+    public StatisticalMeasurementValue addExisting() {
+        return null;
+    }
+
+    /**
+     * {@inheritDoc}
+     */
+    @Override
+    public boolean allowAddExisting() {
+        return false;
+    }
 }
index 69df8bc70372a2b5c3dbd857506e8b2041d65850..c94bb2a5a745e5f9a935d68477beb438469818d4 100644 (file)
@@ -1,8 +1,8 @@
 /**
  * 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.
  */
@@ -44,7 +44,7 @@ public class GrantedAuthorityDetailSection extends
 
        /*
         * (non-Javadoc)
-        * 
+        *
         * @see eu.etaxonomy.taxeditor.ui.section.AbstractEntityCollectionSection#
         * getCollection(java.lang.Object)
         */
@@ -55,7 +55,7 @@ public class GrantedAuthorityDetailSection extends
 
        /*
         * (non-Javadoc)
-        * 
+        *
         * @see eu.etaxonomy.taxeditor.ui.section.AbstractEntityCollectionSection#
         * createNewElement()
         */
@@ -64,14 +64,14 @@ public class GrantedAuthorityDetailSection extends
 //             StoreUtil
 //                             .warningDialog("Not implemented yet", getClass(),
 //                                             "This functionality needs to be implemented in CDM Library first.");
-               
+
                GrantedAuthority selection = GrantedAuthoritySelectionDialog.select(getLayoutComposite().getShell(), getConversationHolder(), null);
                return selection;
        }
 
        /*
         * (non-Javadoc)
-        * 
+        *
         * @see
         * eu.etaxonomy.taxeditor.ui.section.AbstractEntityCollectionSection#addElement
         * (java.lang.Object)
@@ -83,7 +83,7 @@ public class GrantedAuthorityDetailSection extends
 
        /*
         * (non-Javadoc)
-        * 
+        *
         * @see eu.etaxonomy.taxeditor.ui.section.AbstractEntityCollectionSection#
         * removeElement(java.lang.Object)
         */
@@ -94,7 +94,7 @@ public class GrantedAuthorityDetailSection extends
 
        /*
         * (non-Javadoc)
-        * 
+        *
         * @see eu.etaxonomy.taxeditor.ui.section.AbstractEntityCollectionSection#
         * getEmptyString()
         */
@@ -105,7 +105,7 @@ public class GrantedAuthorityDetailSection extends
 
        /*
         * (non-Javadoc)
-        * 
+        *
         * @see eu.etaxonomy.taxeditor.ui.section.AbstractEntityCollectionSection#
         * getTooltipString()
         */
@@ -114,4 +114,20 @@ public class GrantedAuthorityDetailSection extends
                return "Add a Granted Authority";
        }
 
+    /**
+     * {@inheritDoc}
+     */
+    @Override
+    public GrantedAuthority addExisting() {
+        return null;
+    }
+
+    /**
+     * {@inheritDoc}
+     */
+    @Override
+    public boolean allowAddExisting() {
+        return false;
+    }
+
 }
index 44c74035eff302548c53a0118739b36cdc2cbe22..02018f4748c451c3655a4792bfba3a21b333341d 100644 (file)
@@ -88,6 +88,24 @@ public class MemberDetailSection extends AbstractEntityCollectionSection<Group,
                return "Add a memeber to this group";
        }
 
+    /**
+     * {@inheritDoc}
+     */
+    @Override
+    public User addExisting() {
+        // TODO Auto-generated method stub
+        return null;
+    }
+
+    /**
+     * {@inheritDoc}
+     */
+    @Override
+    public boolean allowAddExisting() {
+        // TODO Auto-generated method stub
+        return false;
+    }
+
        
 
 }
index 4735ccd5a6dde0d87e692e8288e5469802c7519c..8c302fcf657d3ccec0ffe905cce7d2cc86306af1 100644 (file)
@@ -56,4 +56,24 @@ public class ScopeRestrictionSection extends AbstractUnboundEntityCollectionSect
                return "Add a scope restriction";
        }
 
+
+    /**
+     * {@inheritDoc}
+     */
+    @Override
+    public DefinedTerm addExisting() {
+        // TODO Auto-generated method stub
+        return null;
+    }
+
+
+    /**
+     * {@inheritDoc}
+     */
+    @Override
+    public boolean allowAddExisting() {
+        // TODO Auto-generated method stub
+        return false;
+    }
+
 }
index 76f96121f61d94e812f6ec2abf8e62408a66121d..df82175ec4185aa98dccaf41a8318fc706f63b21 100644 (file)
@@ -111,4 +111,22 @@ public class TaxonomicScopeSection extends
                return "Add a taxon to the scope of this key";
        }
 
+    /**
+     * {@inheritDoc}
+     */
+    @Override
+    public Taxon addExisting() {
+        // TODO Auto-generated method stub
+        return null;
+    }
+
+    /**
+     * {@inheritDoc}
+     */
+    @Override
+    public boolean allowAddExisting() {
+        // TODO Auto-generated method stub
+        return false;
+    }
+
 }
index e191040b963d1c41a438d565c1da9e5d191e2b44..743f904aa3600dac1b60efc5fc5ae22128e258cb 100644 (file)
@@ -22,7 +22,7 @@ import eu.etaxonomy.taxeditor.ui.section.AbstractEntityCollectionSection;
  */
 public class MediaRepresentationPartSection extends
                AbstractEntityCollectionSection<MediaRepresentation, MediaRepresentationPart> {
-       
+
        /**
         * <p>Constructor for MediaRepresentationPartSection.</p>
         *
@@ -85,5 +85,21 @@ public class MediaRepresentationPartSection extends
                        firePropertyChangeEvent(new CdmPropertyChangeEvent(this, null));
                        super.propertyChange(event);
                }
-       }       
+       }
+
+    /**
+     * {@inheritDoc}
+     */
+    @Override
+    public MediaRepresentationPart addExisting() {
+        return null;
+    }
+
+    /**
+     * {@inheritDoc}
+     */
+    @Override
+    public boolean allowAddExisting() {
+        return false;
+    }
 }
index 41c78e4650352160fe3d57f2098cb099998f59c7..46a0343a4934db436c98cb3edba2188d6d288af4 100644 (file)
@@ -1,8 +1,8 @@
 /**
 * 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.
 */
@@ -39,7 +39,7 @@ public class MediaRepresentationSection extends AbstractEntityCollectionSection<
                        ICdmFormElement parentElement, int style) {
                super(cdmFormFactory, conversation, parentElement, "Media Representation", style);
        }
-       
+
        /** {@inheritDoc} */
        @Override
        public void addElement(MediaRepresentation element) {
@@ -77,5 +77,21 @@ public class MediaRepresentationSection extends AbstractEntityCollectionSection<
                getEntity().removeRepresentation(element);
        }
 
+    /**
+     * {@inheritDoc}
+     */
+    @Override
+    public MediaRepresentation addExisting() {
+        return null;
+    }
+
+    /**
+     * {@inheritDoc}
+     */
+    @Override
+    public boolean allowAddExisting() {
+        return false;
+    }
+
 
 }
index 978c51526cbd01e1ddc4e7be3d82e3a1c3b441de..e85971ef7311f472649f47781d0fd1417f71f81f 100644 (file)
@@ -1,5 +1,5 @@
 /**
- * 
+ *
  */
 package eu.etaxonomy.taxeditor.ui.section.media;
 
@@ -8,6 +8,7 @@ import java.util.Collection;
 import eu.etaxonomy.cdm.api.conversation.ConversationHolder;
 import eu.etaxonomy.cdm.model.media.IdentifiableMediaEntity;
 import eu.etaxonomy.cdm.model.media.Media;
+import eu.etaxonomy.taxeditor.ui.dialog.selection.MediaSelectionDialog;
 import eu.etaxonomy.taxeditor.ui.element.CdmFormFactory;
 import eu.etaxonomy.taxeditor.ui.element.ICdmFormElement;
 import eu.etaxonomy.taxeditor.ui.section.AbstractEntityCollectionSection;
@@ -68,4 +69,20 @@ public class MediaSection extends AbstractEntityCollectionSection<IdentifiableMe
                getEntity().removeMedia(element);
        }
 
+    /**
+     * {@inheritDoc}
+     */
+    @Override
+    public Media addExisting() {
+        return MediaSelectionDialog.select(getShell(), getConversationHolder(), null);
+    }
+
+    /**
+     * {@inheritDoc}
+     */
+    @Override
+    public boolean allowAddExisting() {
+        return true;
+    }
+
 }
index a17870c99ed63f87be385ab4ef4292d3bb0f6670..bcb172286061ea0d9ce7cd2829898eca7db80679 100644 (file)
@@ -116,4 +116,20 @@ public class NameRelationshipDetailSection extends AbstractEntityCollectionSecti
        public TaxonBase getTaxonBase() {
                return taxonBase;
        }
+
+    /**
+     * {@inheritDoc}
+     */
+    @Override
+    public NameRelationship addExisting() {
+        return null;
+    }
+
+    /**
+     * {@inheritDoc}
+     */
+    @Override
+    public boolean allowAddExisting() {
+        return false;
+    }
 }
index 6161360998005a4c322d7c91d54a65c03ba69ecf..7b1bfa5a323ef82905332fec3f9d00f77555b7ae 100644 (file)
@@ -1,8 +1,8 @@
 /**
 * 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.
 */
@@ -83,12 +83,13 @@ public class NomenclaturalStatusSection extends AbstractEntityCollectionSection<
        }
 
        /** {@inheritDoc} */
-       public void setTaxonBase(TaxonBase entity) {
+       @Override
+    public void setTaxonBase(TaxonBase entity) {
                this.taxonBase = entity;
                NonViralName nonViralName = (NonViralName) HibernateProxyHelper.deproxy(entity.getName());
                setEntity(nonViralName);
        }
-       
+
        /* (non-Javadoc)
         * @see eu.etaxonomy.taxeditor.section.ITaxonDetailSection#getTaxon(eu.etaxonomy.cdm.model.taxon.TaxonBase)
         */
@@ -97,4 +98,20 @@ public class NomenclaturalStatusSection extends AbstractEntityCollectionSection<
                return taxonBase;
        }
 
+    /**
+     * {@inheritDoc}
+     */
+    @Override
+    public NomenclaturalStatus addExisting() {
+        return null;
+    }
+
+    /**
+     * {@inheritDoc}
+     */
+    @Override
+    public boolean allowAddExisting() {
+        return false;
+    }
+
 }
index 90ee563842131af32a43e85dedeff8a8d5b35008..250b4b608e601f33ec334f4e719cd0e32c0ce17c 100644 (file)
@@ -17,17 +17,14 @@ import org.eclipse.swt.SWT;
 import org.eclipse.swt.widgets.Control;
 
 import eu.etaxonomy.cdm.api.conversation.ConversationHolder;
-import eu.etaxonomy.cdm.api.service.ITaxonNodeService;
 import eu.etaxonomy.cdm.hibernate.HibernateProxyHelper;
 import eu.etaxonomy.cdm.model.name.NonViralName;
 import eu.etaxonomy.cdm.model.name.TaxonNameBase;
 import eu.etaxonomy.cdm.model.taxon.TaxonBase;
-import eu.etaxonomy.cdm.model.taxon.TaxonNode;
 import eu.etaxonomy.taxeditor.model.ImageResources;
 import eu.etaxonomy.taxeditor.model.MessagingUtils;
 import eu.etaxonomy.taxeditor.preference.IPreferenceKeys;
 import eu.etaxonomy.taxeditor.preference.PreferencesUtil;
-import eu.etaxonomy.taxeditor.store.CdmStore;
 import eu.etaxonomy.taxeditor.ui.dialog.selection.NameSelectionDialog;
 import eu.etaxonomy.taxeditor.ui.element.CdmFormFactory;
 import eu.etaxonomy.taxeditor.ui.element.CdmPropertyChangeEvent;
@@ -75,7 +72,6 @@ public class NonViralNameDetailSection extends AbstractCdmDetailSection<NonViral
                            TaxonNameBase taxonName = NameSelectionDialog.select(getShell(), getConversationHolder(), getEntity());
                            if(taxonName!=null){
                                if(taxonName.isInstanceOf(NonViralName.class)){
-                                   CdmStore.getService(ITaxonNodeService.class).list(TaxonNode.class, null, null, null, null);
                                    NonViralName nonViralName = HibernateProxyHelper.deproxy(taxonName, NonViralName.class);
                                    taxonBase.setName(nonViralName);
                                    //                                  taxonBase.getTitleCache();
index c001631b8020e5458d10c60afd64d6472b0e1fa4..5135b2f4f66363a671c75ec835da2f47f4fe2d67 100644 (file)
@@ -138,4 +138,20 @@ public class ProtologueSection extends AbstractEntityCollectionSection<TaxonName
        public TaxonBase getTaxonBase() {
                return taxonBase;
        }
+
+    /**
+     * {@inheritDoc}
+     */
+    @Override
+    public DescriptionElementBase addExisting() {
+        return null;
+    }
+
+    /**
+     * {@inheritDoc}
+     */
+    @Override
+    public boolean allowAddExisting() {
+        return false;
+    }
 }
index 838b6bf083f85f885333e33dbc8c30e53f2c64e3..da65f9793199bf3fc8c4801aa481853f16090bdd 100644 (file)
@@ -125,4 +125,20 @@ public class TypeDesignationSection extends AbstractEntityCollectionSection<Taxo
        public TaxonBase getTaxonBase() {
                return taxonBase;
        }
+
+    /**
+     * {@inheritDoc}
+     */
+    @Override
+    public TypeDesignationBase addExisting() {
+        return null;
+    }
+
+    /**
+     * {@inheritDoc}
+     */
+    @Override
+    public boolean allowAddExisting() {
+        return false;
+    }
 }
index b66f13dc9c19d7246a2300db81851362778d5da2..a47e134fbb22a552619411f7c59adc3983fc634e 100644 (file)
@@ -100,4 +100,20 @@ public class CollectingAreasDetailSection extends AbstractEntityCollectionSectio
                return "Add a collecting area";
        }
 
+    /**
+     * {@inheritDoc}
+     */
+    @Override
+    public NamedArea addExisting() {
+        return null;
+    }
+
+    /**
+     * {@inheritDoc}
+     */
+    @Override
+    public boolean allowAddExisting() {
+        return false;
+    }
+
 }
index d8b22d0a6a4ed98d7d3e8d6023c0f2678bc97088..6f97a6b7bfe26b328eafc58b20ae6bfb837709d7 100644 (file)
@@ -118,4 +118,20 @@ public class CurrentDeterminationDetailSection extends
                return "Create new current determination event";
        }
 
+    /**
+     * {@inheritDoc}
+     */
+    @Override
+    public DeterminationEvent addExisting() {
+        return null;
+    }
+
+    /**
+     * {@inheritDoc}
+     */
+    @Override
+    public boolean allowAddExisting() {
+        return false;
+    }
+
 }
index 1c042a399e310766bff4339243e23adaf6542c63..6e7867b5d35f7eac47ef9bc66cb7d14f134ae693 100644 (file)
@@ -1,8 +1,8 @@
 /**
 * 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.
 */
@@ -44,12 +44,12 @@ public class DeterminationHistoryDetailSection extends
        public Collection<DeterminationEvent> getCollection(DerivedUnitFacade entity) {
                return entity != null ? entity.getOtherDeterminations() : null;
        }
-       
+
        @Override
        public void refresh() {
                internalUpdateSection(false);
        }
-       
+
 
        /* (non-Javadoc)
         * @see eu.etaxonomy.taxeditor.section.AbstractEntityCollectionSection#getTooltipString()
@@ -60,4 +60,20 @@ public class DeterminationHistoryDetailSection extends
                return "Add a determination event to the history";
        }
 
+    /**
+     * {@inheritDoc}
+     */
+    @Override
+    public DeterminationEvent addExisting() {
+        return null;
+    }
+
+    /**
+     * {@inheritDoc}
+     */
+    @Override
+    public boolean allowAddExisting() {
+        return false;
+    }
+
 }
index 6bbdc7e53e4d3526648eeb3a42995bbc32fbfefe..6a7eeda118f54f3bfd11f91aed5acf071bbe4604 100644 (file)
@@ -99,4 +99,21 @@ public class GeoScopeDetailSection extends AbstractEntityCollectionSection<Class
                return "Add a geo scope";
        }
 
+    /**
+     * {@inheritDoc}
+     */
+    @Override
+    public NamedArea addExisting() {
+        return null;
+    }
+
+    /**
+     * {@inheritDoc}
+     */
+    @Override
+    public boolean allowAddExisting() {
+        // TODO Auto-generated method stub
+        return false;
+    }
+
 }
index 34e092f481e0aa85406ca9d02db2db966fe01d48..5029c9e1fe1603367a916145ef32cba2f97e0cf0 100644 (file)
@@ -70,4 +70,20 @@ public class GeoScopePolyKeyDetailSection extends AbstractEntityCollectionSectio
                return "Add a geo scope";
        }
 
+    /**
+     * {@inheritDoc}
+     */
+    @Override
+    public NamedArea addExisting() {
+        return null;
+    }
+
+    /**
+     * {@inheritDoc}
+     */
+    @Override
+    public boolean allowAddExisting() {
+        return false;
+    }
+
 }
index dee731f4d32312198c5f2db5ead39cadef67062d..e1d1e3c0e39368bc4fa88f9c8d39803b214a56b4 100644 (file)
@@ -1,8 +1,8 @@
 /**
 * 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.
 */
@@ -57,7 +57,7 @@ public class SourceCollectionDetailSection extends
        /** {@inheritDoc} */
        @Override
        public IdentifiableSource createNewElement() {
-               return IdentifiableSource.NewInstance(OriginalSourceType.PrimaryTaxonomicSource);               
+               return IdentifiableSource.NewInstance(OriginalSourceType.PrimaryTaxonomicSource);
        }
 
        /* (non-Javadoc)
@@ -96,4 +96,20 @@ public class SourceCollectionDetailSection extends
                return "Add source";
        }
 
+    /**
+     * {@inheritDoc}
+     */
+    @Override
+    public IdentifiableSource addExisting() {
+        return null;
+    }
+
+    /**
+     * {@inheritDoc}
+     */
+    @Override
+    public boolean allowAddExisting() {
+        return false;
+    }
+
 }
index 8a2e99c480bbaa88150c96cbb8d295f7a4449903..0c2758ec25b68dacf4cad7f21aaa8a167920d5be 100644 (file)
@@ -1,8 +1,8 @@
 /**
 * 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.
 */
@@ -56,8 +56,8 @@ public class SpecimenCollectionDetailSection extends
         */
        /** {@inheritDoc} */
        @Override
-       public DerivedUnit createNewElement() {         
-               return DerivedUnit.NewInstance(SpecimenOrObservationType.PreservedSpecimen);            
+       public DerivedUnit createNewElement() {
+               return DerivedUnit.NewInstance(SpecimenOrObservationType.PreservedSpecimen);
        }
 
        /* (non-Javadoc)
@@ -96,4 +96,20 @@ public class SpecimenCollectionDetailSection extends
                return "Add a duplicate";
        }
 
+    /**
+     * {@inheritDoc}
+     */
+    @Override
+    public DerivedUnit addExisting() {
+        return null;
+    }
+
+    /**
+     * {@inheritDoc}
+     */
+    @Override
+    public boolean allowAddExisting() {
+        return false;
+    }
+
 }
index 215646f365891b4289688f2e37c68ad1eed4a78c..5afff341a9d4073c045a286aceb0737d673f1330 100644 (file)
@@ -86,5 +86,21 @@ public class DerivedUnitTypeDesignationSection extends AbstractEntityCollectionS
         return "Add a type designation";
     }
 
+    /**
+     * {@inheritDoc}
+     */
+    @Override
+    public SpecimenTypeDesignation addExisting() {
+        return null;
+    }
+
+    /**
+     * {@inheritDoc}
+     */
+    @Override
+    public boolean allowAddExisting() {
+        return false;
+    }
+
 
 }
index 7d22a739effcae706d47015181d2ff892203b4d8..b30f3a8f277a83d8dc79d93047d42d9a59f53a4a 100644 (file)
@@ -131,4 +131,20 @@ public class PreservedSpecimenCurrentDeterminationDetailSection extends
                return "Create new current determination event";
        }
 
+    /**
+     * {@inheritDoc}
+     */
+    @Override
+    public DeterminationEvent addExisting() {
+        return null;
+    }
+
+    /**
+     * {@inheritDoc}
+     */
+    @Override
+    public boolean allowAddExisting() {
+        return false;
+    }
+
 }
index d7deac8da6024329e9b7d761db8753319ceeaf20..3a35bbf0649fed76dcde636c33ddbd9b265b7a43 100644 (file)
@@ -96,4 +96,20 @@ public class PreservedSpecimenSourceCollectionDetailSection extends
                return "Add source";
        }
 
+    /**
+     * {@inheritDoc}
+     */
+    @Override
+    public IdentifiableSource addExisting() {
+        return null;
+    }
+
+    /**
+     * {@inheritDoc}
+     */
+    @Override
+    public boolean allowAddExisting() {
+        return false;
+    }
+
 }
index ebba487def9d639d0bc6a371a63ba9e2fec67cb3..0c30ec363b84512ea86d86d7210da51cd0d9fe5a 100644 (file)
@@ -96,4 +96,24 @@ public class AmplificationGelPhotoCollectionDetailSection extends AbstractEntity
         return "Add a gel photo";
     }
 
+
+
+    /**
+     * {@inheritDoc}
+     */
+    @Override
+    public Media addExisting() {
+        return null;
+    }
+
+
+
+    /**
+     * {@inheritDoc}
+     */
+    @Override
+    public boolean allowAddExisting() {
+        return false;
+    }
+
 }
index 42f8a470777fa8258cb8091783030722ba79b2af..815a4341945cb8a6b323145d361f3f406e6189ee 100644 (file)
@@ -73,4 +73,20 @@ public class CurrentSampleDesignationDetailSection extends AbstractSampleDesigna
         getEntity().addIdentifier(0, sampleDesignation);
     }
 
+    /**
+     * {@inheritDoc}
+     */
+    @Override
+    public Identifier addExisting() {
+        return null;
+    }
+
+    /**
+     * {@inheritDoc}
+     */
+    @Override
+    public boolean allowAddExisting() {
+        return false;
+    }
+
 }
index b018896e83d14a0e77cf8fd777a3c0cd875f27f1..d4bfaa64164de9688c0d7c77e967039a46b65155 100644 (file)
@@ -84,4 +84,20 @@ public class SampleDesignationHistoryDetailSection extends AbstractSampleDesigna
         getEntity().addIdentifier(indexOfCurrentSampleDesignation+1, sampleDesignation);
     }
 
+    /**
+     * {@inheritDoc}
+     */
+    @Override
+    public Identifier addExisting() {
+        return null;
+    }
+
+    /**
+     * {@inheritDoc}
+     */
+    @Override
+    public boolean allowAddExisting() {
+        return false;
+    }
+
 }
index a4f60268af8cfd137940b561189357b57f29461e..f32d9cc10c4715a85296ccc7ebdf0c037213dacf 100644 (file)
@@ -72,7 +72,7 @@ public class SequenceContigFileCollectionDetailSection extends AbstractEntityCol
             getEntity().setContigFile(element);
                        /*
                         * merge to avoid duplicate key exception
-                        * the exception seems to be caused by the two links to the Media object: 
+                        * the exception seems to be caused by the two links to the Media object:
                         *  - Sequence->contigFile (used to be not in the cache after saving)
                         *  - MediaRepresentationPart->media
                         *  Invoking merge() solves this problem
@@ -104,4 +104,24 @@ public class SequenceContigFileCollectionDetailSection extends AbstractEntityCol
     protected String getTooltipString() {
         return "Add a contig file";
     }
+
+
+
+    /**
+     * {@inheritDoc}
+     */
+    @Override
+    public Media addExisting() {
+        return null;
+    }
+
+
+
+    /**
+     * {@inheritDoc}
+     */
+    @Override
+    public boolean allowAddExisting() {
+        return false;
+    }
 }
index 220dae784ee2e32819fb2ac8166105d976330c0e..14ae973fa94058bca82a37dc2f05f61e6e8b7bbe 100644 (file)
@@ -84,5 +84,21 @@ public class SequenceReferenceCollectionDetailSection extends AbstractUnboundEnt
         return "Add a reference";
     }
 
+    /**
+     * {@inheritDoc}
+     */
+    @Override
+    public Reference addExisting() {
+        return null;
+    }
+
+    /**
+     * {@inheritDoc}
+     */
+    @Override
+    public boolean allowAddExisting() {
+        return false;
+    }
+
 
 }
index 869a382148ddbb03eb0dccf3273a50cb669cb119..2ad7553993876883362d0029876538119a954a59 100644 (file)
@@ -72,7 +72,7 @@ public class SingleReadPherogramCollectionDetailSection extends AbstractEntityCo
             getEntity().setPherogram(element);
                        /*
                         * merge to avoid duplicate key exception
-                        * the exception seems to be caused by the two links to the Media object: 
+                        * the exception seems to be caused by the two links to the Media object:
                         *  - SingleRead->pherogram (used to be not in the cache after saving)
                         *  - MediaRepresentationPart->media
                         *  Invoking merge() solves this problem
@@ -104,4 +104,24 @@ public class SingleReadPherogramCollectionDetailSection extends AbstractEntityCo
     protected String getTooltipString() {
         return "Add a read chromatogram";
     }
+
+
+
+    /**
+     * {@inheritDoc}
+     */
+    @Override
+    public Media addExisting() {
+        return null;
+    }
+
+
+
+    /**
+     * {@inheritDoc}
+     */
+    @Override
+    public boolean allowAddExisting() {
+        return false;
+    }
 }
index 2a7fff5d2bdfde8d75d2ea6afdaa4cbf52779539..188a551e944da128ec7da2692c6eac68cf1ec464 100644 (file)
@@ -74,5 +74,23 @@ public class AnnotationSection extends AbstractEntityCollectionSection<Annotatab
        @Override
        public void removeElement(Annotation element) {
                getEntity().removeAnnotation(element);
-       }       
+       }
+
+    /**
+     * {@inheritDoc}
+     */
+    @Override
+    public Annotation addExisting() {
+        // TODO Auto-generated method stub
+        return null;
+    }
+
+    /**
+     * {@inheritDoc}
+     */
+    @Override
+    public boolean allowAddExisting() {
+        // TODO Auto-generated method stub
+        return false;
+    }  
 }
index 107b6b20a774c94454938ba0d5492e665577aceb..d5c85e834ab6c1af0983975695566726c100501e 100644 (file)
@@ -69,4 +69,22 @@ public class CreditSection extends AbstractEntityCollectionSection<IdentifiableE
                getEntity().removeCredit(element);
        }
 
+    /**
+     * {@inheritDoc}
+     */
+    @Override
+    public Credit addExisting() {
+        // TODO Auto-generated method stub
+        return null;
+    }
+
+    /**
+     * {@inheritDoc}
+     */
+    @Override
+    public boolean allowAddExisting() {
+        // TODO Auto-generated method stub
+        return false;
+    }
+
 }
index 7e0c0c8af05f11410a0d675f24e51a2533b0db3b..ef2b8f69b03272c3833c9ab3907d02b166996667 100644 (file)
@@ -70,4 +70,22 @@ public class ExtensionSection extends AbstractEntityCollectionSection<Identifiab
                getEntity().removeExtension(element);
        }
 
+    /**
+     * {@inheritDoc}
+     */
+    @Override
+    public Extension addExisting() {
+        // TODO Auto-generated method stub
+        return null;
+    }
+
+    /**
+     * {@inheritDoc}
+     */
+    @Override
+    public boolean allowAddExisting() {
+        // TODO Auto-generated method stub
+        return false;
+    }
+
 }
index 9d7dba4562032edc56a5dec3cf63a03b5403de7d..0185c840a423f144abe7c281a8a9617a8c44cfad 100644 (file)
@@ -64,4 +64,22 @@ public class MarkerSection extends AbstractUnboundEntityCollectionSection<Annota
         return entity.getMarkers();
     }
 
+    /**
+     * {@inheritDoc}
+     */
+    @Override
+    public Marker addExisting() {
+        // TODO Auto-generated method stub
+        return null;
+    }
+
+    /**
+     * {@inheritDoc}
+     */
+    @Override
+    public boolean allowAddExisting() {
+        // TODO Auto-generated method stub
+        return false;
+    }
+
 }
index 02d1b4eba00c7d75c31c947d7f93fb369624f6ba..991aa0eaf4a9aa81aa56a91a4ee45f04e3e10e3b 100644 (file)
@@ -69,4 +69,22 @@ public class RightsSection extends AbstractEntityCollectionSection<IdentifiableE
                getEntity().removeRights(element);
        }
 
+    /**
+     * {@inheritDoc}
+     */
+    @Override
+    public Rights addExisting() {
+        // TODO Auto-generated method stub
+        return null;
+    }
+
+    /**
+     * {@inheritDoc}
+     */
+    @Override
+    public boolean allowAddExisting() {
+        // TODO Auto-generated method stub
+        return false;
+    }
+
 }
index ae4b637d59aa7fc0c2a88e03a5f2530243f2bd6f..32c108d6732135fa1b416e6b79a846673518fbc1 100644 (file)
@@ -87,4 +87,22 @@ public class SourceSection extends AbstractEntityCollectionSection<IIdentifiable
                getEntity().removeSource(element);
        }
 
+    /**
+     * {@inheritDoc}
+     */
+    @Override
+    public IdentifiableSource addExisting() {
+        // TODO Auto-generated method stub
+        return null;
+    }
+
+    /**
+     * {@inheritDoc}
+     */
+    @Override
+    public boolean allowAddExisting() {
+        // TODO Auto-generated method stub
+        return false;
+    }
+
 }
index c955165d1a8a74bc66065a117ca01195b594e5ad..9e59fd95301685b68b59fb9bbc1d55e2392cd79b 100644 (file)
@@ -48,4 +48,22 @@ public class DerivedUnitFacadeIdentifierSection extends AbstractIdentifierSectio
                getEntity().removeIdentifier(element);
        }
 
+    /**
+     * {@inheritDoc}
+     */
+    @Override
+    public Identifier addExisting() {
+        // TODO Auto-generated method stub
+        return null;
+    }
+
+    /**
+     * {@inheritDoc}
+     */
+    @Override
+    public boolean allowAddExisting() {
+        // TODO Auto-generated method stub
+        return false;
+    }
+
 }
index 47c0714c6d36424e39fb5441ff7265653f82d458..c7a526e5bfd9a9124d1dd0d46c8c72bb696c84eb 100644 (file)
@@ -45,4 +45,22 @@ public class IdentifierSection extends AbstractIdentifierSection<IdentifiableEnt
                getEntity().removeIdentifier(element);
        }
 
+    /**
+     * {@inheritDoc}
+     */
+    @Override
+    public Identifier addExisting() {
+        // TODO Auto-generated method stub
+        return null;
+    }
+
+    /**
+     * {@inheritDoc}
+     */
+    @Override
+    public boolean allowAddExisting() {
+        // TODO Auto-generated method stub
+        return false;
+    }
+
 }
index 75f83615adc1b7ccf7d2f26f9589c856d4b34484..e9b8b1b73b84c0cbee46417c0048d57e4eaad83a 100644 (file)
@@ -1,5 +1,5 @@
 /**
- * 
+ *
  */
 package eu.etaxonomy.taxeditor.ui.section.user;
 
@@ -80,5 +80,23 @@ public class GroupsByUserDetailSection extends AbstractEntityCollectionSection<U
        protected String getTooltipString() {
                return "Add this user to a group";
        }
-       
+
+    /**
+     * {@inheritDoc}
+     */
+    @Override
+    public Group addExisting() {
+        // TODO Auto-generated method stub
+        return null;
+    }
+
+    /**
+     * {@inheritDoc}
+     */
+    @Override
+    public boolean allowAddExisting() {
+        // TODO Auto-generated method stub
+        return false;
+    }
+
 }
index 53417143cd34ee4e94cbc7d3bace9d32f512df57..a2e9daacd58284916962ca8123ab275753f6efaa 100644 (file)
@@ -83,4 +83,22 @@ public class MeasurementUnitCollectionSection extends AbstractUnboundEntityColle
         return "Add a measurement unit";
     }
 
+    /**
+     * {@inheritDoc}
+     */
+    @Override
+    public MeasurementUnit addExisting() {
+        // TODO Auto-generated method stub
+        return null;
+    }
+
+    /**
+     * {@inheritDoc}
+     */
+    @Override
+    public boolean allowAddExisting() {
+        // TODO Auto-generated method stub
+        return false;
+    }
+
 }
index 1b8b1601c466f7474e58b9d321347303fb9eaa23..6f00dd0782150bdfb48eaf46a51bacd0066f3154 100644 (file)
@@ -85,5 +85,23 @@ public class RecommendedModifierVocabulariesCollectionSection extends AbstractUn
         return "Add a modifier vocabulary";
     }
 
+    /**
+     * {@inheritDoc}
+     */
+    @Override
+    public TermVocabulary<DefinedTerm> addExisting() {
+        // TODO Auto-generated method stub
+        return null;
+    }
+
+    /**
+     * {@inheritDoc}
+     */
+    @Override
+    public boolean allowAddExisting() {
+        // TODO Auto-generated method stub
+        return false;
+    }
+
 
 }
index 6a2d2050064c14481b185295829b8083fb5a7e31..76f47c9022e5c7948800e5d642ff2f22a290cedf 100644 (file)
@@ -85,5 +85,23 @@ public class StateVocabularyCollectionSection extends AbstractUnboundEntityColle
         return "Add a state vocabulary";
     }
 
+    /**
+     * {@inheritDoc}
+     */
+    @Override
+    public TermVocabulary<State> addExisting() {
+        // TODO Auto-generated method stub
+        return null;
+    }
+
+    /**
+     * {@inheritDoc}
+     */
+    @Override
+    public boolean allowAddExisting() {
+        // TODO Auto-generated method stub
+        return false;
+    }
+
 
 }
index 25e490a8b260e45bb9238501d90492bf24d6cd90..2487f538a65786d0c3223633d18825208bb8a6a9 100644 (file)
@@ -83,4 +83,22 @@ public class StatisticalMeasureCollectionSection extends AbstractUnboundEntityCo
         return "Add a statistical measure";
     }
 
+    /**
+     * {@inheritDoc}
+     */
+    @Override
+    public StatisticalMeasure addExisting() {
+        // TODO Auto-generated method stub
+        return null;
+    }
+
+    /**
+     * {@inheritDoc}
+     */
+    @Override
+    public boolean allowAddExisting() {
+        // TODO Auto-generated method stub
+        return false;
+    }
+
 }