Refactor SingleReadContextMenu #5406
authorPatrick Plitzner <p.plitzner@bgbm.org>
Wed, 20 Jan 2016 08:39:46 +0000 (09:39 +0100)
committerPatrick Plitzner <p.plitzner@bgbm.org>
Wed, 20 Jan 2016 08:40:17 +0000 (09:40 +0100)
 - split into separate commands, property testers and menu items
 - adjusted molecular context menu entries to be grouped together with
singler read entries

eu.etaxonomy.taxeditor.editor/plugin.xml
eu.etaxonomy.taxeditor.editor/src/main/java/eu/etaxonomy/taxeditor/editor/handler/SpecimenPropertyTester.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/contextMenu/DerivateViewContextMenu.java
eu.etaxonomy.taxeditor.editor/src/main/java/eu/etaxonomy/taxeditor/editor/view/derivate/contextMenu/SingleReadSequenceContextMenu.java [deleted file]
eu.etaxonomy.taxeditor.editor/src/main/java/eu/etaxonomy/taxeditor/editor/view/derivate/handler/SingleReadHandler.java [new file with mode: 0644]
eu.etaxonomy.taxeditor.molecular/plugin.xml
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/view/derivateSearch/DerivateLabelProvider.java

index 928c3b5811735fd8c176fcb816256b29c61217a3..70e779d74ef3c91104fae1f6f30c5dcc408d5351 100644 (file)
                name="eu.etaxonomy.taxeditor.editor.separator3"
                visible="true">
          </separator>
+         <command
+               commandId="eu.etaxonomy.taxeditor.editor.derivative.reuseSingleRead"
+               id="eu.etaxonomy.taxeditor.editor.derivative.reuseSingleReadMenuItem"
+               label="Reuse single read here"
+               style="push">
+            <visibleWhen
+                  checkEnabled="true">
+               <reference
+                     definitionId="isSingleReadReusableHere">
+               </reference>
+            </visibleWhen>
+         </command>
+         <command
+               commandId="eu.etaxonomy.taxeditor.editor.derivative.copySingleReadToClipBoard"
+               label="Reuse for other sequence"
+               style="push">
+            <visibleWhen
+                  checkEnabled="true">
+               <reference
+                     definitionId="isSingleRead">
+               </reference>
+            </visibleWhen>
+         </command>
+         <command
+               commandId="eu.etaxonomy.taxeditor.editor.derivative.removeSingleReadFromSequence"
+               label="Remove from this sequence"
+               style="push">
+            <visibleWhen
+                  checkEnabled="true">
+               <reference
+                     definitionId="isSingleReadReused">
+               </reference>
+            </visibleWhen>
+         </command>
+         <separator
+               name="eu.etaxonomy.taxeditor.editor.separator7"
+               visible="true">
+         </separator>
          <command
                commandId="org.eclipse.ui.edit.delete"
                label="%command.label.52"
             id="eu.etaxonomy.taxeditor.editor.derivative.listenToSelectionChange"
             name="Link with taxon selection">
       </command>
+      <command
+            defaultHandler="eu.etaxonomy.taxeditor.editor.view.derivate.handler.SingleReadHandler"
+            id="eu.etaxonomy.taxeditor.editor.derivative.copySingleReadToClipBoard"
+            name="Copy SingleRead to clipboard">
+      </command>
+      <command
+            defaultHandler="eu.etaxonomy.taxeditor.editor.view.derivate.handler.SingleReadHandler"
+            id="eu.etaxonomy.taxeditor.editor.derivative.reuseSingleRead"
+            name="Reuse SingleRead">
+      </command>
+      <command
+            defaultHandler="eu.etaxonomy.taxeditor.editor.view.derivate.handler.SingleReadHandler"
+            id="eu.etaxonomy.taxeditor.editor.derivative.removeSingleReadFromSequence"
+            name="Remove SingleRead from sequence">
+      </command>
         
    </extension>
    <extension
             </test>
          </with>
       </definition>
+      <definition
+            id="isSingleReadReusableHere">
+         <with
+               variable="selection">
+            <test
+                  property="eu.etaxonomy.taxeditor.editor.handler.SpecimenPropertyTester.isSingleReadReusableHere">
+            </test>
+         </with>
+      </definition>
+      <definition
+            id="isSingleReadReused">
+         <with
+               variable="selection">
+            <test
+                  property="eu.etaxonomy.taxeditor.editor.handler.SpecimenPropertyTester.isSingleReadReused">
+            </test>
+         </with>
+      </definition>
    </extension>
    <extension
          point="org.eclipse.core.expressions.propertyTesters">
             class="eu.etaxonomy.taxeditor.editor.handler.SpecimenPropertyTester"
             id="eu.etaxonomy.taxeditor.editor.handler.SpecimenPropertyTester"
             namespace="eu.etaxonomy.taxeditor.editor.handler.SpecimenPropertyTester"
-            properties="isSequence,isSingleRead"
+            properties="isSequence,isSingleRead,isSingleReadReusableHere,isSingleReadReused"
             type="org.eclipse.jface.viewers.IStructuredSelection">
       </propertyTester>
    </extension>
index eb3995c8e6bb215aa3602a0449e2f30a852b9bec..ec87507347dcae1450e3727e8a03b29fea76c186 100644 (file)
@@ -2,12 +2,17 @@ package eu.etaxonomy.taxeditor.editor.handler;
 
 
 import org.eclipse.core.expressions.PropertyTester;
+import org.eclipse.jface.util.LocalSelectionTransfer;
 import org.eclipse.jface.viewers.IStructuredSelection;
 import org.eclipse.jface.viewers.TreeNode;
+import org.eclipse.ui.IEditorPart;
+import org.eclipse.ui.IWorkbenchWindow;
+import org.eclipse.ui.PlatformUI;
 
 import eu.etaxonomy.cdm.model.molecular.Sequence;
 import eu.etaxonomy.cdm.model.molecular.SingleRead;
 import eu.etaxonomy.taxeditor.editor.EditorUtil;
+import eu.etaxonomy.taxeditor.editor.view.derivate.DerivateView;
 
 
 
@@ -20,6 +25,8 @@ import eu.etaxonomy.taxeditor.editor.EditorUtil;
 public class SpecimenPropertyTester extends PropertyTester {
     private static final String SEQUENCE = "isSequence";
     private static final String SINGLE_READ = "isSingleRead";
+    private static final String IS_SINGLEREAD_REUSABLE_HERE = "isSingleReadReusableHere";
+    private static final String IS_SINGLEREAD_REUSED = "isSingleReadReused";
 
 
     public SpecimenPropertyTester() {}
@@ -37,12 +44,39 @@ public class SpecimenPropertyTester extends PropertyTester {
                 else if (SINGLE_READ.equals(property)) {
                        return isSingleReadAlignment(treeNodeOfSelection.getValue());
                 }
+                else if (IS_SINGLEREAD_REUSABLE_HERE.equals(property)) {
+                    return isSingleReadReusableHere(treeNodeOfSelection.getValue());
+                }
+                else if (IS_SINGLEREAD_REUSED.equals(property)) {
+                    return isSingleReadReused(treeNodeOfSelection.getValue());
+                }
             }
         }
         return false;
     }
 
-       private boolean isSequence(Object object) {
+    private boolean isSingleReadReused(Object value) {
+        final IWorkbenchWindow window = PlatformUI.getWorkbench().getActiveWorkbenchWindow();
+        final IEditorPart activeEditor = window.getActivePage().getActiveEditor();
+        if(value instanceof SingleRead){
+            if(activeEditor instanceof DerivateView
+                    && ((DerivateView) activeEditor).getMultiLinkSingleReads().contains(value)){
+                return true;
+            }
+        }
+        return false;
+    }
+
+    private boolean isSingleReadReusableHere(Object value) {
+        TreeNode clipboardNode = EditorUtil.getTreeNodeOfSelection(LocalSelectionTransfer.getTransfer().getSelection());
+        if(value instanceof Sequence && clipboardNode!=null && clipboardNode.getValue() instanceof SingleRead
+                && !((Sequence) value).getSingleReads().contains(clipboardNode.getValue())){
+            return true;
+        }
+        return false;
+    }
+
+    private boolean isSequence(Object object) {
        return (object instanceof Sequence);
        }
 
index b53525b988b30086ec883404b51b9f134f86d288..f591b9a14f6451889bae885cddb9827bc510d54b 100644 (file)
@@ -271,13 +271,17 @@ public class DerivateView extends EditorPart implements IPartContentHasFactualDa
                     rootElements.add(specimen);
                 }
             }
-            labelProvider.initCache(rootElements);
+            labelProvider.updateLabelCache(rootElements);
             viewer.setInput(rootElements);
 
             getEditorSite().getActionBars().getStatusLineManager().setMessage(rootElements.size() +" derivative hierarchies found");
 
     }
 
+    public void updateLabelCache(){
+        labelProvider.updateLabelCache(rootElements);
+    }
+
     @Override
     public void doSave(IProgressMonitor monitor) {
         String taskName = Messages.DerivateView_SAVING_HIERARCHY;
index e14001f39206293c17392844dae638d4af9129b0..c89c7c85d0c38bee2fab44873041e6b5fb69fdab 100644 (file)
@@ -11,7 +11,6 @@ public class DerivateViewContextMenu extends CompoundContributionItem  {
         IContributionItem[] contributionItems = new IContributionItem[] {
                 new CreateDerivateContextMenu(),
                 new CreateFieldUnitContextMenu(),
-                new SingleReadSequenceContextMenu(),
                 new Separator(),
                 new ListenToSelectionChangeContextMenu(),
         };
diff --git a/eu.etaxonomy.taxeditor.editor/src/main/java/eu/etaxonomy/taxeditor/editor/view/derivate/contextMenu/SingleReadSequenceContextMenu.java b/eu.etaxonomy.taxeditor.editor/src/main/java/eu/etaxonomy/taxeditor/editor/view/derivate/contextMenu/SingleReadSequenceContextMenu.java
deleted file mode 100644 (file)
index 9f431f4..0000000
+++ /dev/null
@@ -1,154 +0,0 @@
-package eu.etaxonomy.taxeditor.editor.view.derivate.contextMenu;
-
-import org.eclipse.jface.action.ContributionItem;
-import org.eclipse.jface.action.IContributionItem;
-import org.eclipse.jface.action.Separator;
-import org.eclipse.jface.util.LocalSelectionTransfer;
-import org.eclipse.jface.viewers.ISelection;
-import org.eclipse.jface.viewers.TreeNode;
-import org.eclipse.swt.SWT;
-import org.eclipse.swt.events.SelectionAdapter;
-import org.eclipse.swt.events.SelectionEvent;
-import org.eclipse.swt.widgets.Menu;
-import org.eclipse.swt.widgets.MenuItem;
-import org.eclipse.ui.IEditorPart;
-import org.eclipse.ui.IWorkbenchWindow;
-import org.eclipse.ui.PlatformUI;
-import org.eclipse.ui.actions.CompoundContributionItem;
-
-import eu.etaxonomy.cdm.api.service.molecular.ISequenceService;
-import eu.etaxonomy.cdm.model.molecular.Sequence;
-import eu.etaxonomy.cdm.model.molecular.SingleRead;
-import eu.etaxonomy.taxeditor.editor.EditorUtil;
-import eu.etaxonomy.taxeditor.editor.Messages;
-import eu.etaxonomy.taxeditor.editor.view.derivate.DerivateView;
-import eu.etaxonomy.taxeditor.model.MessagingUtils;
-import eu.etaxonomy.taxeditor.store.CdmStore;
-
-/**
- * Context menu for the SingleReads in the derivate hierarchy.
- *
- */
-public class SingleReadSequenceContextMenu extends CompoundContributionItem {
-
-    private enum CommandType{
-        COPY_TO_CLIPBOARD,
-        REMOVE_FROM_SEQUENCE,
-        ADD_TO_SEQUENCE
-    }
-
-    @Override
-    protected IContributionItem[] getContributionItems() {
-        boolean menuVisible = false;
-        final IWorkbenchWindow window = PlatformUI.getWorkbench().getActiveWorkbenchWindow();
-        final ISelection selection = window.getActivePage().getSelection();
-        TreeNode selectedTreeNode = EditorUtil.getTreeNodeOfSelection(selection);
-        TreeNode clipboardNode = EditorUtil.getTreeNodeOfSelection(LocalSelectionTransfer.getTransfer().getSelection());
-        if(selectedTreeNode!=null &&
-                (selectedTreeNode.getValue() instanceof Sequence && clipboardNode!=null && clipboardNode.getValue() instanceof SingleRead)
-                || (selectedTreeNode.getValue() instanceof SingleRead)){
-            menuVisible = true;
-        }
-        IContributionItem[] contributionItems = new IContributionItem[0];
-        if(menuVisible){
-            contributionItems = new IContributionItem[] {
-                    new Separator(),
-                    new ContributionItem() {
-                        @Override
-                        public void fill(Menu menu, int index) {
-                            final IWorkbenchWindow window = PlatformUI.getWorkbench().getActiveWorkbenchWindow();
-                            final IEditorPart activeEditor = window.getActivePage().getActiveEditor();
-                            final ISelection selection = window.getActivePage().getSelection();
-                            TreeNode selectedTreeNode = EditorUtil.getTreeNodeOfSelection(selection);
-                            TreeNode clipboardNode = EditorUtil.getTreeNodeOfSelection(LocalSelectionTransfer.getTransfer().getSelection());
-                            if(selectedTreeNode!=null){
-                                //context menu for Sequence
-                                if(selectedTreeNode.getValue() instanceof Sequence
-                                        && clipboardNode!=null && clipboardNode.getValue() instanceof SingleRead){
-                                    MenuItem item = new MenuItem(menu, SWT.NONE);
-                                    item.setText(Messages.SingleReadSequenceContextMenu_REUSE_SINGLE_READ_HERE);
-                                    item.addSelectionListener(new WidgetSelectionListener(CommandType.ADD_TO_SEQUENCE));
-                                }
-                                else if(selectedTreeNode.getValue() instanceof SingleRead){
-                                    MenuItem item = new MenuItem(menu, SWT.NONE);
-                                    item.setText(Messages.SingleReadSequenceContextMenu_REUSE_FOR_SEQUENCE);
-                                    item.addSelectionListener(new WidgetSelectionListener(CommandType.COPY_TO_CLIPBOARD));
-                                    if(activeEditor instanceof DerivateView
-                                            && ((DerivateView) activeEditor).getMultiLinkSingleReads().contains(selectedTreeNode.getValue())){
-                                        MenuItem unlinkItem = new MenuItem(menu, SWT.NONE);
-                                        unlinkItem.setText(Messages.SingleReadSequenceContextMenu_REMOVE_FROM_SEQUENCE);
-                                        unlinkItem.addSelectionListener(new WidgetSelectionListener(CommandType.REMOVE_FROM_SEQUENCE));
-                                    }
-                                }
-                            }
-                        }
-                    }
-            };
-        }
-        return contributionItems;
-    }
-
-    private class WidgetSelectionListener extends SelectionAdapter{
-        private final CommandType commandType;
-
-        /**
-         * @param selectedTreeNode
-         * @param clipboardNode
-         * @param commandType
-         */
-        public WidgetSelectionListener(CommandType commandType) {
-            this.commandType = commandType;
-        }
-
-        @Override
-        public void widgetSelected(SelectionEvent e) {
-            IEditorPart activeEditor = PlatformUI.getWorkbench().getActiveWorkbenchWindow().getActivePage().getActiveEditor();
-            ISelection clipBoardSelection = LocalSelectionTransfer.getTransfer().getSelection();
-            final ISelection selection = PlatformUI.getWorkbench().getActiveWorkbenchWindow().getActivePage().getSelection();
-            TreeNode clipBoardTreeNode = EditorUtil.getTreeNodeOfSelection(clipBoardSelection);
-            TreeNode selectedTreeNode = EditorUtil.getTreeNodeOfSelection(selection);
-            switch (commandType) {
-            case REMOVE_FROM_SEQUENCE:
-                if(activeEditor.isDirty()){
-                    MessagingUtils.warningDialog(DerivateView.VIEW_HAS_UNSAVED_CHANGES, this, DerivateView.YOU_NEED_TO_SAVE_BEFORE_PERFORMING_THIS_ACTION);
-                    return;
-                }
-                if(selectedTreeNode!=null && selectedTreeNode.getParent()!=null &&
-                        selectedTreeNode.getValue() instanceof SingleRead && selectedTreeNode.getParent().getValue() instanceof Sequence) {
-                    Sequence sequence = (Sequence) selectedTreeNode.getParent().getValue();
-                    sequence.removeSingleRead((SingleRead) selectedTreeNode.getValue());
-                    CdmStore.getService(ISequenceService.class).saveOrUpdate(sequence);
-                    if(activeEditor instanceof DerivateView) {
-                        DerivateView derivateView = (DerivateView)activeEditor;
-                        derivateView.getConversationHolder().commit();
-                        derivateView.refreshTree();
-                    }
-                }
-
-                break;
-            case ADD_TO_SEQUENCE:
-                if(activeEditor.isDirty()){
-                    MessagingUtils.warningDialog(DerivateView.VIEW_HAS_UNSAVED_CHANGES, this, DerivateView.YOU_NEED_TO_SAVE_BEFORE_PERFORMING_THIS_ACTION);
-                    return;
-                }
-                if(clipBoardTreeNode!=null && clipBoardTreeNode.getValue() instanceof SingleRead
-                        && selectedTreeNode!=null && selectedTreeNode.getValue() instanceof Sequence){
-                    SingleRead singleRead = (SingleRead)clipBoardTreeNode.getValue();
-                    Sequence sequence = (Sequence)selectedTreeNode.getValue();
-                    sequence.addSingleRead(singleRead);
-                    CdmStore.getService(ISequenceService.class).merge(sequence);
-                    if(activeEditor instanceof DerivateView) {
-                        DerivateView derivateView = (DerivateView)activeEditor;
-                        derivateView.getConversationHolder().commit();
-                        derivateView.refreshTree();
-                        LocalSelectionTransfer.getTransfer().setSelection(null);
-                    }
-                }
-                break;
-            case COPY_TO_CLIPBOARD:
-                LocalSelectionTransfer.getTransfer().setSelection(selection);
-                break;
-            }
-        }
-    }
-}
diff --git a/eu.etaxonomy.taxeditor.editor/src/main/java/eu/etaxonomy/taxeditor/editor/view/derivate/handler/SingleReadHandler.java b/eu.etaxonomy.taxeditor.editor/src/main/java/eu/etaxonomy/taxeditor/editor/view/derivate/handler/SingleReadHandler.java
new file mode 100644 (file)
index 0000000..ba5f2b9
--- /dev/null
@@ -0,0 +1,84 @@
+package eu.etaxonomy.taxeditor.editor.view.derivate.handler;
+
+import org.eclipse.core.commands.AbstractHandler;
+import org.eclipse.core.commands.ExecutionEvent;
+import org.eclipse.core.commands.ExecutionException;
+import org.eclipse.jface.util.LocalSelectionTransfer;
+import org.eclipse.jface.viewers.ISelection;
+import org.eclipse.jface.viewers.TreeNode;
+import org.eclipse.ui.IEditorPart;
+import org.eclipse.ui.PlatformUI;
+
+import eu.etaxonomy.cdm.api.service.molecular.ISequenceService;
+import eu.etaxonomy.cdm.model.molecular.Sequence;
+import eu.etaxonomy.cdm.model.molecular.SingleRead;
+import eu.etaxonomy.taxeditor.editor.EditorUtil;
+import eu.etaxonomy.taxeditor.editor.view.derivate.DerivateView;
+import eu.etaxonomy.taxeditor.model.MessagingUtils;
+import eu.etaxonomy.taxeditor.store.CdmStore;
+
+public class SingleReadHandler extends AbstractHandler {
+
+    @Override
+    public Object execute(ExecutionEvent event) throws ExecutionException {
+        IEditorPart activeEditor = PlatformUI.getWorkbench().getActiveWorkbenchWindow().getActivePage().getActiveEditor();
+        ISelection clipBoardSelection = LocalSelectionTransfer.getTransfer().getSelection();
+        final ISelection selection = PlatformUI.getWorkbench().getActiveWorkbenchWindow().getActivePage().getSelection();
+        TreeNode clipBoardTreeNode = EditorUtil.getTreeNodeOfSelection(clipBoardSelection);
+        TreeNode selectedTreeNode = EditorUtil.getTreeNodeOfSelection(selection);
+        if(activeEditor instanceof DerivateView) {
+            DerivateView derivateView = (DerivateView)activeEditor;
+            if(event.getCommand().getId().equals("eu.etaxonomy.taxeditor.editor.derivative.copySingleReadToClipBoard")){
+                LocalSelectionTransfer.getTransfer().setSelection(selection);
+            }
+            else if(event.getCommand().getId().equals("eu.etaxonomy.taxeditor.editor.derivative.reuseSingleRead")){
+                if(activeEditor.isDirty()){
+                    MessagingUtils.warningDialog(DerivateView.VIEW_HAS_UNSAVED_CHANGES, this, DerivateView.YOU_NEED_TO_SAVE_BEFORE_PERFORMING_THIS_ACTION);
+                    return null;
+                }
+                if(clipBoardTreeNode!=null && clipBoardTreeNode.getValue() instanceof SingleRead
+                        && selectedTreeNode!=null && selectedTreeNode.getValue() instanceof Sequence){
+                    SingleRead singleRead = (SingleRead)clipBoardTreeNode.getValue();
+                    Sequence sequence = (Sequence)selectedTreeNode.getValue();
+                    sequence.addSingleRead(singleRead);
+                    if(CdmStore.getCurrentSessionManager().isRemoting()){
+                        CdmStore.getService(ISequenceService.class).merge(sequence);
+                    }
+                    else{
+                        CdmStore.getService(ISequenceService.class).saveOrUpdate(sequence);
+                    }
+                    if(activeEditor instanceof DerivateView) {
+                        derivateView.getConversationHolder().commit();
+                        derivateView.refreshTree();
+                        LocalSelectionTransfer.getTransfer().setSelection(null);
+                    }
+                }
+            }
+            else if(event.getCommand().getId().equals("eu.etaxonomy.taxeditor.editor.derivative.removeSingleReadFromSequence")){
+                if(activeEditor.isDirty()){
+                    MessagingUtils.warningDialog(DerivateView.VIEW_HAS_UNSAVED_CHANGES, this, DerivateView.YOU_NEED_TO_SAVE_BEFORE_PERFORMING_THIS_ACTION);
+                    return null;
+                }
+                if(selectedTreeNode!=null && selectedTreeNode.getParent()!=null &&
+                        selectedTreeNode.getValue() instanceof SingleRead && selectedTreeNode.getParent().getValue() instanceof Sequence) {
+                    Sequence sequence = (Sequence) selectedTreeNode.getParent().getValue();
+                    sequence.removeSingleRead((SingleRead) selectedTreeNode.getValue());
+                    if(CdmStore.getCurrentSessionManager().isRemoting()){
+                        CdmStore.getService(ISequenceService.class).merge(sequence);
+                    }
+                    else{
+                        CdmStore.getService(ISequenceService.class).saveOrUpdate(sequence);
+                    }
+                    if(activeEditor instanceof DerivateView) {
+                        derivateView.getConversationHolder().commit();
+                        derivateView.refreshTree();
+                    }
+                }
+            }
+            derivateView.updateLabelCache();
+            derivateView.refreshTree();
+        }
+        return null;
+    }
+
+}
index c38adc24dddfbf68e5241610c6e64d83dfa7b24a..749f4dedd8d5e1ff6d40b6452092fd2f4da0da42 100644 (file)
             </menu>
          </menuContribution>
          <menuContribution
-               locationURI="popup:eu.etaxonomy.taxeditor.editor.view.derivate.DerivateView?after=eu.etaxonomy.taxeditor.editor.view.derivate.DerivateContextMenu">
+               locationURI="popup:eu.etaxonomy.taxeditor.editor.view.derivate.DerivateView?before=eu.etaxonomy.taxeditor.editor.derivative.reuseSingleReadMenuItem">
             <separator
                   name="eu.etaxonomy.taxeditor.molecular.separator5"
                   visible="true">
index 36c5e9278f4a4c007fb5719c40d3c69278f14ef3..14265f1d5f179233886d219201d6128b78435e42 100644 (file)
@@ -432,7 +432,7 @@ public class DerivateLabelProvider extends ColumnLabelProvider {
         return multiLinkSingleReads;
     }
 
-    public void initCache(Collection<SpecimenOrObservationBase<?>> rootElements) {
+    public void updateLabelCache(Collection<SpecimenOrObservationBase<?>> rootElements) {
         DerivateLabelProvider.multiLinkSingleReads = new HashSet<SingleRead>();
         DerivateLabelProvider.typeDesignations = new HashMap<DerivedUnit, Collection<SpecimenTypeDesignation>>();
         for(Entry<SingleRead, Collection<Sequence>> entry:CdmStore.getService(ISequenceService.class).getSingleReadSequencesMap().entrySet()){