Convert DerivateView to an EditorPart root/branches/taxeditor/unify_derivative_views
authorPatrick Plitzner <p.plitzner@bgbm.org>
Wed, 11 Nov 2015 16:03:41 +0000 (17:03 +0100)
committerPatrick Plitzner <p.plitzner@bgbm.org>
Wed, 11 Nov 2015 16:03:41 +0000 (17:03 +0100)
eu.etaxonomy.taxeditor.editor/plugin.xml
eu.etaxonomy.taxeditor.editor/src/main/java/eu/etaxonomy/taxeditor/editor/handler/OpenDerivateViewHandler.java
eu.etaxonomy.taxeditor.editor/src/main/java/eu/etaxonomy/taxeditor/editor/view/derivate/DerivateView.java
eu.etaxonomy.taxeditor.editor/src/main/java/eu/etaxonomy/taxeditor/editor/view/derivate/DerivateViewEditorInput.java
eu.etaxonomy.taxeditor.editor/src/main/java/eu/etaxonomy/taxeditor/editor/view/derivate/handler/OpenDerivateEditorForTaxonHandler.java [deleted file]
eu.etaxonomy.taxeditor.editor/src/main/java/eu/etaxonomy/taxeditor/editor/view/derivate/searchFilter/DerivateSearchComposite.java
eu.etaxonomy.taxeditor.editor/src/main/java/eu/etaxonomy/taxeditor/editor/view/derivate/searchFilter/DerivateSearchCompositeController.java

index c4e90a5f644373e65922664c0198766161337a6b..b7ca0b2d2f03a80d7747a438fc89311f75618e65 100644 (file)
             id="eu.etaxonomy.taxeditor.editor.view.checklist.ChecklistEditor"
             name="%editor.name.8">
       </editor>
+         <editor
+               class="eu.etaxonomy.taxeditor.editor.view.derivate.DerivateView"
+               default="false"
+               icon="icons/derivate_view-16x16-32.png"
+               id="eu.etaxonomy.taxeditor.editor.view.derivate.DerivateView"
+               name="Derivative Editor">
+         </editor>
    </extension>
       <extension
             point="org.eclipse.ui.views">
                id="eu.etaxonomy.taxeditor.editor.view.validation.problems"
                name="%view.name.6">
          </view>
-         <view
-               class="eu.etaxonomy.taxeditor.editor.view.derivate.DerivateView"
-               icon="icons/derivate_view-16x16-32.png"
-               id="eu.etaxonomy.taxeditor.editor.view.derivate.DerivateView"
-               name="Derivative Editor"
-               restorable="true">
-         </view>
       </extension>
       
        <!-- VALIDATION RELATED STUFF -->
                </or>
             </visibleWhen>
          </menu>
-         <separator
-               name="taxeditor-editor.separator1"
-               visible="true">
-         </separator>
-         <command
-               commandId="eu.etaxonomy.taxeditor.editor.handler.openDerivateView"
-               label="%command.label.51"
-               style="push">
-            <visibleWhen
-                  checkEnabled="true">
-               <and>
-                  <with
-                        variable="selection">
-                     <count
-                           value="+">
-                     </count>
-                  </with>
-                  <reference
-                        definitionId="isIndividualsAssociation">
-                  </reference>
-               </and>
-            </visibleWhen>
-         </command>
          <command
                commandId="eu.etaxonomy.taxeditor.editor.view.descriptive.command.moveDescriptionToTaxon"
                label="%command.label.28"
             </with>
          </activeWhen>
       </handler>
-      <handler
-            class="eu.etaxonomy.taxeditor.editor.view.derivate.handler.OpenDerivateEditorForTaxonHandler"
-            commandId="eu.etaxonomy.taxeditor.editor.handler.openDerivateView">
-         <activeWhen>
-            <with
-                  variable="activePartId">
-               <equals
-                     value="eu.etaxonomy.taxeditor.navigation.navigator">
-               </equals>
-            </with>
-         </activeWhen>
-      </handler>
       <handler
             class="eu.etaxonomy.taxeditor.editor.view.descriptive.handler.ToggleShowOnlyIndividualAssociationsHandler"
             commandId="eu.etaxonomy.taxeditor.editor.handler.showOnlyIndividualAssociations">
             defaultHandler="eu.etaxonomy.taxeditor.editor.group.authority.handler.EditCdmAuthoritiesHandler"
             id="eu.etaxonomy.taxeditor.group.cdmauthorities.edit"
             name="%command.name.34">
-      </command>
-      <command
-            defaultHandler="eu.etaxonomy.taxeditor.editor.handler.OpenDerivateViewHandler"
-            id="eu.etaxonomy.taxeditor.editor.handler.openDerivateView"
-            name="%command.name.35">
       </command>
        <command
              defaultHandler="eu.etaxonomy.taxeditor.editor.handler.OpenChecklistEditorHandler"
index 04307863d72e1f37b23bd45899aae9e0089015d5..4ef59f6c1433f5935d69d4292783e69bb6cca948 100644 (file)
@@ -3,15 +3,21 @@ package eu.etaxonomy.taxeditor.editor.handler;
 import org.eclipse.core.commands.AbstractHandler;
 import org.eclipse.core.commands.ExecutionEvent;
 import org.eclipse.core.commands.ExecutionException;
+import org.eclipse.ui.PartInitException;
 
-import eu.etaxonomy.taxeditor.editor.view.derivate.DerivateView;
-import eu.etaxonomy.taxeditor.model.AbstractUtility;
+import eu.etaxonomy.taxeditor.editor.EditorUtil;
+import eu.etaxonomy.taxeditor.editor.view.derivate.DerivateViewEditorInput;
+import eu.etaxonomy.taxeditor.model.MessagingUtils;
 
 public class OpenDerivateViewHandler extends AbstractHandler {
 
     @Override
     public Object execute(ExecutionEvent event) throws ExecutionException {
-        AbstractUtility.showView(DerivateView.ID);
+        try {
+            EditorUtil.open(new DerivateViewEditorInput());
+        } catch (PartInitException e) {
+            MessagingUtils.error(OpenDerivateViewHandler.class, "Derivative Editor could not be opened", e);
+        }
         return null;
     }
 
index 178c3f7f598010b1214797bbf3a6fbbe254c1991..ba2b3168117fa00724603b78ea2823dda7670a34 100644 (file)
@@ -29,12 +29,18 @@ import org.eclipse.swt.widgets.Composite;
 import org.eclipse.swt.widgets.Control;
 import org.eclipse.swt.widgets.Menu;
 import org.eclipse.swt.widgets.Tree;
+import org.eclipse.ui.IEditorInput;
 import org.eclipse.ui.IEditorPart;
+import org.eclipse.ui.IEditorSite;
 import org.eclipse.ui.IMemento;
-import org.eclipse.ui.ISaveablePart2;
+import org.eclipse.ui.ISelectionListener;
+import org.eclipse.ui.ISelectionService;
 import org.eclipse.ui.IWorkbenchPart;
+import org.eclipse.ui.PartInitException;
+import org.eclipse.ui.part.EditorPart;
 
 import eu.etaxonomy.cdm.api.conversation.ConversationHolder;
+import eu.etaxonomy.cdm.api.conversation.IConversationEnabled;
 import eu.etaxonomy.cdm.api.service.IOccurrenceService;
 import eu.etaxonomy.cdm.hibernate.HibernateProxyHelper;
 import eu.etaxonomy.cdm.model.common.CdmBase;
@@ -42,18 +48,21 @@ import eu.etaxonomy.cdm.model.molecular.SingleRead;
 import eu.etaxonomy.cdm.model.occurrence.FieldUnit;
 import eu.etaxonomy.cdm.model.occurrence.SpecimenOrObservationBase;
 import eu.etaxonomy.cdm.model.taxon.Taxon;
+import eu.etaxonomy.cdm.model.taxon.TaxonNode;
 import eu.etaxonomy.cdm.persistence.hibernate.CdmDataChangeMap;
 import eu.etaxonomy.taxeditor.editor.EditorUtil;
 import eu.etaxonomy.taxeditor.editor.Messages;
 import eu.etaxonomy.taxeditor.editor.view.derivate.searchFilter.DerivateSearchCompositeController;
 import eu.etaxonomy.taxeditor.model.IContextListener;
+import eu.etaxonomy.taxeditor.model.IDirtyMarkable;
 import eu.etaxonomy.taxeditor.model.IPartContentHasDetails;
 import eu.etaxonomy.taxeditor.model.IPartContentHasFactualData;
 import eu.etaxonomy.taxeditor.model.IPartContentHasMedia;
 import eu.etaxonomy.taxeditor.model.IPartContentHasSupplementalData;
+import eu.etaxonomy.taxeditor.operation.IPostOperationEnabled;
 import eu.etaxonomy.taxeditor.session.ICdmEntitySession;
+import eu.etaxonomy.taxeditor.session.ICdmEntitySessionEnabled;
 import eu.etaxonomy.taxeditor.store.CdmStore;
-import eu.etaxonomy.taxeditor.view.AbstractCdmViewPart;
 import eu.etaxonomy.taxeditor.view.derivateSearch.DerivateContentProvider;
 import eu.etaxonomy.taxeditor.view.derivateSearch.DerivateLabelProvider;
 
@@ -61,8 +70,9 @@ import eu.etaxonomy.taxeditor.view.derivateSearch.DerivateLabelProvider;
  * Displays the derivate hierarchy of the specimen specified in the editor input.
  *
  */
-public class DerivateView extends AbstractCdmViewPart implements IPartContentHasFactualData, ISaveablePart2,
-        IPartContentHasDetails, IPartContentHasSupplementalData, IPartContentHasMedia, IContextListener {
+public class DerivateView extends EditorPart implements IPartContentHasFactualData, IConversationEnabled,
+        ICdmEntitySessionEnabled, IDirtyMarkable, IPostOperationEnabled, IPartContentHasDetails, IPartContentHasSupplementalData, IPartContentHasMedia,
+        IContextListener, ISelectionListener {
     public static final String ID = "eu.etaxonomy.taxeditor.editor.view.derivate.DerivateView"; //$NON-NLS-1$
 
     public static final String YOU_NEED_TO_SAVE_BEFORE_PERFORMING_THIS_ACTION = Messages.DerivateView_YOU_NEED_TO_SAVE;
@@ -118,17 +128,22 @@ public class DerivateView extends AbstractCdmViewPart implements IPartContentHas
 
     private Taxon selectedTaxon;
 
+    private ISelectionService selectionService;
+
     /**
      * Default constructor
      */
     public DerivateView() {
-        init();
     }
 
+
     /**
-     *
+     * {@inheritDoc}
      */
-    private void init() {
+    @Override
+    public void init(IEditorSite site, IEditorInput input) throws PartInitException {
+        this.setSite(site);
+        this.setInput(input);
         this.derivateToRootEntityMap = new HashMap<SpecimenOrObservationBase<?>, SpecimenOrObservationBase<?>>();
         this.rootElements = new HashSet<SpecimenOrObservationBase<?>>();
 
@@ -314,14 +329,6 @@ public class DerivateView extends AbstractCdmViewPart implements IPartContentHas
         return conversation;
     }
 
-    /**
-     * @return the viewer
-     */
-    @Override
-    public TreeViewer getViewer() {
-        return viewer;
-    }
-
     @Override
     public void changed(Object element) {
         setDirty(true);
@@ -452,10 +459,18 @@ public class DerivateView extends AbstractCdmViewPart implements IPartContentHas
 
     @Override
     public void selectionChanged(IWorkbenchPart part, ISelection selection) {
+        if(viewer.getTree().isDisposed()){
+            return;
+        }
         if(listenToSelectionChange && selection instanceof IStructuredSelection){
             Object selectedElement = ((IStructuredSelection) selection).getFirstElement();
-            if(selectedElement instanceof CdmBase && ((CdmBase) selectedElement).isInstanceOf(Taxon.class)){
-                selectedTaxon = HibernateProxyHelper.deproxy(selectedElement, Taxon.class);
+            if(selectedElement instanceof CdmBase){
+                if(((CdmBase) selectedElement).isInstanceOf(TaxonNode.class)){
+                    selectedTaxon = HibernateProxyHelper.deproxy(selectedElement, TaxonNode.class).getTaxon();
+                }
+                else if(((CdmBase) selectedElement).isInstanceOf(Taxon.class)){
+                    selectedTaxon = HibernateProxyHelper.deproxy(selectedElement, Taxon.class);
+                }
                 Collection<SpecimenOrObservationBase> fieldUnits = CdmStore.getService(IOccurrenceService.class).listFieldUnitsByAssociatedTaxon(selectedTaxon, null, null);
                 Collection<UUID> uuids = new HashSet<UUID>();
                 for (SpecimenOrObservationBase specimenOrObservationBase : fieldUnits) {
@@ -467,6 +482,10 @@ public class DerivateView extends AbstractCdmViewPart implements IPartContentHas
         }
     }
 
+    public TreeViewer getViewer() {
+        return viewer;
+    }
+
     /**
      * {@inheritDoc}
      */
@@ -475,22 +494,6 @@ public class DerivateView extends AbstractCdmViewPart implements IPartContentHas
         return new ArrayList<SpecimenOrObservationBase<?>>(rootElements);
     }
 
-    @Override
-    public void createViewer(Composite parent) {
-        // TODO Auto-generated method stub
-
-    }
-
-    @Override
-    public boolean isSaveOnCloseNeeded() {
-        return isDirty();
-    }
-
-    @Override
-    public int promptToSaveOnClose() {
-        return ISaveablePart2.DEFAULT;
-    }
-
     public void toggleListenToSelectionChange() {
         listenToSelectionChange = !listenToSelectionChange;
         derivateSearchCompositeController.setEnabled(!listenToSelectionChange);
@@ -529,7 +532,6 @@ public class DerivateView extends AbstractCdmViewPart implements IPartContentHas
      */
     @Override
     public void contextStart(IMemento memento, IProgressMonitor monitor) {
-        init();
         derivateSearchCompositeController.setEnabled(!listenToSelectionChange);
         viewer.getTree().setEnabled(true);
         refreshTree();
index 950533d113f7481f3717cbf08b95eb872a1055ab..6f7b3be6064b582003bbd05e3c0c6e22b2c1cfe4 100644 (file)
 */
 package eu.etaxonomy.taxeditor.editor.view.derivate;
 
-import java.util.Set;
-import java.util.UUID;
-
 import org.eclipse.jface.resource.ImageDescriptor;
 import org.eclipse.ui.IEditorInput;
 import org.eclipse.ui.IPersistableElement;
 
-import eu.etaxonomy.cdm.model.occurrence.FieldUnit;
-import eu.etaxonomy.cdm.model.occurrence.SpecimenOrObservationBase;
-
 /**
- * Editor input for the {@link DerivateView} which holds the currently selected derivate for which
- * the derivate hierarchy should be shown in the DerivateView.<br>
- * It also holds a {@link SpecimenOrObservationBase} which is the root of the hierarchy. (both may be the same object)
+ * Editor input for the {@link DerivateView}
+ *
  * @author pplitzner
- * @date 25.11.2013
+ * @date Nov 11, 2015
  *
  */
 public class DerivateViewEditorInput implements IEditorInput {
 
-    /**
-     * The {@link UUID}s of the derivative entities
-     */
-    private Set<UUID> derivativeUUIDs;
-
-    /**
-     * Creates an editor input for the {@link DerivateView} with the currently selected derivates and the
-     * corresponding {@link FieldUnit}s (both may be the same object).
-     * @param derivateUuids the {@link UUID}s of the derivates for which the derivate hierarchy should be shown
-     * @param derivativeUUIDs the root of the hierarchy
-     */
-    public DerivateViewEditorInput(Set<UUID> derivateUuids) {
-        this.derivativeUUIDs = derivateUuids;
+    public DerivateViewEditorInput() {
     }
 
-    /* (non-Javadoc)
-     * @see org.eclipse.core.runtime.IAdaptable#getAdapter(java.lang.Class)
-     */
     @Override
     public Object getAdapter(Class adapter) {
-        // TODO Auto-generated method stub
         return null;
     }
 
-    /* (non-Javadoc)
-     * @see org.eclipse.ui.IEditorInput#exists()
-     */
     @Override
     public boolean exists() {
         return false;
     }
 
-    /* (non-Javadoc)
-     * @see org.eclipse.ui.IEditorInput#getImageDescriptor()
-     */
     @Override
     public ImageDescriptor getImageDescriptor() {
-        // TODO Auto-generated method stub
         return null;
     }
 
-    /* (non-Javadoc)
-     * @see org.eclipse.ui.IEditorInput#getName()
-     */
     @Override
     public String getName() {
         return getEditorName();
     }
 
-    /* (non-Javadoc)
-     * @see org.eclipse.ui.IEditorInput#getPersistable()
-     */
     @Override
     public IPersistableElement getPersistable() {
         return null;
     }
 
-    /* (non-Javadoc)
-     * @see org.eclipse.ui.IEditorInput#getToolTipText()
-     */
     @Override
     public String getToolTipText() {
         return getEditorName();
     }
 
     private String getEditorName() {
-            return "Derivative Editor";
-    }
-
-    /**
-     * @return the derivativeUUIDs
-     */
-    public Set<UUID> getDerivativeUUIDs() {
-        return derivativeUUIDs;
-    }
-
-    @Override
-    public int hashCode() {
-        final int prime = 31;
-        int result = 1;
-        result = prime * result + ((derivativeUUIDs == null) ? 0 : derivativeUUIDs.hashCode());
-        return result;
-    }
-
-    @Override
-    public boolean equals(Object obj) {
-        if (this == obj) {
-            return true;
-        }
-        if (obj == null) {
-            return false;
-        }
-        if (getClass() != obj.getClass()) {
-            return false;
-        }
-        DerivateViewEditorInput other = (DerivateViewEditorInput) obj;
-        if (derivativeUUIDs == null) {
-            if (other.derivativeUUIDs != null) {
-                return false;
-            }
-        } else if (!derivativeUUIDs.equals(other.derivativeUUIDs)) {
-            return false;
-        }
-        return true;
+        return "Derivative Editor";
     }
 
 }
diff --git a/eu.etaxonomy.taxeditor.editor/src/main/java/eu/etaxonomy/taxeditor/editor/view/derivate/handler/OpenDerivateEditorForTaxonHandler.java b/eu.etaxonomy.taxeditor.editor/src/main/java/eu/etaxonomy/taxeditor/editor/view/derivate/handler/OpenDerivateEditorForTaxonHandler.java
deleted file mode 100644 (file)
index 7b30737..0000000
+++ /dev/null
@@ -1,82 +0,0 @@
-// $Id$
-/**
-* Copyright (C) 2014 EDIT
-* 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.editor.view.derivate.handler;
-
-import java.util.HashSet;
-import java.util.Iterator;
-import java.util.List;
-import java.util.Set;
-import java.util.UUID;
-
-import org.eclipse.core.commands.AbstractHandler;
-import org.eclipse.core.commands.ExecutionEvent;
-import org.eclipse.core.commands.ExecutionException;
-import org.eclipse.jface.viewers.ISelection;
-import org.eclipse.jface.viewers.IStructuredSelection;
-import org.eclipse.ui.PartInitException;
-import org.eclipse.ui.handlers.HandlerUtil;
-
-import eu.etaxonomy.cdm.api.service.IOccurrenceService;
-import eu.etaxonomy.cdm.model.occurrence.SpecimenOrObservationBase;
-import eu.etaxonomy.cdm.model.taxon.Taxon;
-import eu.etaxonomy.cdm.model.taxon.TaxonNode;
-import eu.etaxonomy.taxeditor.editor.EditorUtil;
-import eu.etaxonomy.taxeditor.editor.Messages;
-import eu.etaxonomy.taxeditor.editor.handler.OpenDerivateViewHandler;
-import eu.etaxonomy.taxeditor.editor.view.derivate.DerivateViewEditorInput;
-import eu.etaxonomy.taxeditor.model.MessagingUtils;
-import eu.etaxonomy.taxeditor.store.CdmStore;
-
-/**
- * @author pplitzner
- * @date Nov 25, 2014
- *
- */
-public class OpenDerivateEditorForTaxonHandler extends AbstractHandler {
-
-    private static final String COULD_NOT_OPEN_DERIVATIVE_EDITOR = Messages.OpenDerivateEditorForTaxonHandler_COULD_NOT_OPEN_EDITOR;
-
-    /* (non-Javadoc)
-     * @see org.eclipse.core.commands.IHandler#execute(org.eclipse.core.commands.ExecutionEvent)
-     */
-    @Override
-    public Object execute(ExecutionEvent event) throws ExecutionException {
-        ISelection currentSelection = HandlerUtil.getCurrentSelection(event);
-        if(currentSelection instanceof IStructuredSelection){
-            Iterator<?> selectionIterator = ((IStructuredSelection) currentSelection).iterator();
-            Set<UUID> derivateUuids = new HashSet<UUID>();
-            while(selectionIterator.hasNext()){
-                Object object = selectionIterator.next();
-                if(object instanceof TaxonNode){
-                    TaxonNode node = (TaxonNode)object;
-                    Taxon taxon = node.getTaxon();
-                     List<SpecimenOrObservationBase> listByAssociatedTaxon = CdmStore.getService(IOccurrenceService.class).listByAssociatedTaxon(null, null, taxon, null, null, null, null, null);
-                     for (SpecimenOrObservationBase specimenOrObservationBase : listByAssociatedTaxon) {
-                         derivateUuids.add(specimenOrObservationBase.getUuid());
-                    }
-                }
-            }
-            if(derivateUuids.isEmpty()){
-                MessagingUtils.warningDialog(COULD_NOT_OPEN_DERIVATIVE_EDITOR, this, Messages.OpenDerivateEditorForTaxonHandler_NO_DERIVATIVES_FOUND);
-                return null;
-            }
-            DerivateViewEditorInput input = new DerivateViewEditorInput(derivateUuids);
-            try {
-                EditorUtil.open(input);
-            } catch (PartInitException e) {
-                MessagingUtils.error(OpenDerivateViewHandler.class, COULD_NOT_OPEN_DERIVATIVE_EDITOR, e);
-            } catch (NullPointerException npe){
-                MessagingUtils.messageDialog(Messages.OpenDerivateEditorForTaxonHandler_FAILED_TO_OPEN, OpenDerivateViewHandler.class, Messages.OpenDerivateEditorForTaxonHandler_HIERARCHY_CORRUPTED, npe);
-            }
-        }
-        return null;
-    }
-
-}
index b34b7ab192b7a03c6a02cf44ea3080237f1e2d74..02f3e5d051038f21156117d35f045b057f7155de 100644 (file)
@@ -43,6 +43,7 @@ public class DerivateSearchComposite extends Composite {
     private Label lbltaxonAssignment;
     private Combo comboTaxonAssignment;
     private Label lblTitleCache;
+    private Button buttonToggleLink;
 
     /**
      * Create the composite.
@@ -81,7 +82,11 @@ public class DerivateSearchComposite extends Composite {
         formToolkit.adapt(comboTaxonAssignment);
         formToolkit.paintBordersFor(comboTaxonAssignment);
         comboTaxonAssignment.select(ALL_SPECIMENS);
-        new Label(this, SWT.NONE);
+
+        buttonToggleLink = new Button(this, SWT.NONE);
+        buttonToggleLink.setLayoutData(new GridData(SWT.RIGHT, SWT.CENTER, false, false, 1, 1));
+        buttonToggleLink.setImage(ResourceManager.getPluginImage("eu.etaxonomy.taxeditor.editor", "icons/synced.gif"));
+        formToolkit.adapt(buttonToggleLink, true, true);
 
         lblTitleCache = new Label(this, SWT.NONE);
         lblTitleCache.setLayoutData(new GridData(SWT.RIGHT, SWT.CENTER, false, false, 1, 1));
@@ -156,4 +161,7 @@ public class DerivateSearchComposite extends Composite {
     public Label getLbltaxonAssignment() {
         return lbltaxonAssignment;
     }
+    public Button getButtonToggleLink() {
+        return buttonToggleLink;
+    }
 }
index e87fcc5aa4b7b4af58379b51f6f7a24485697511..50d91e66a0ab44512791f7557a24134d281a36d4 100644 (file)
@@ -65,6 +65,7 @@ public class DerivateSearchCompositeController implements Listener{
         derivateSearchComposite.getButtonSearch().addListener(SWT.Selection, this);
         derivateSearchComposite.getBtnBrowseTaxa().addListener(SWT.Selection, this);
         derivateSearchComposite.getBtnClearTaxon().addListener(SWT.Selection, this);
+        derivateSearchComposite.getButtonToggleLink().addListener(SWT.Selection, this);
 
     }
 
@@ -145,6 +146,9 @@ public class DerivateSearchCompositeController implements Listener{
             derivateSearchComposite.getComboTaxonAssignment().setEnabled(true);
             derivateSearchComposite.getLbltaxonAssignment().setEnabled(true);
         }
+        else if(eventSource==derivateSearchComposite.getButtonToggleLink()){
+            derivativeEditor.toggleListenToSelectionChange();
+        }
     }
 
     /**