commit a022f6f00831483e4331d63b932740dc01fa7013
Author: Patric Plitzner <p.plitzner@bgbm.org>
Date:   Mon Oct 14 07:51:49 2013 +0000

     - derivate view shows derivate hierarchy of FieldUnits and DerivedUnits

diff --git a/.gitattributes b/.gitattributes
index 3288a9212..780377389 100644
--- a/.gitattributes
+++ b/.gitattributes
@@ -117,7 +117,7 @@ eu.etaxonomy.taxeditor.bulkeditor/src/main/java/eu/etaxonomy/taxeditor/bulkedito
 eu.etaxonomy.taxeditor.bulkeditor/src/main/java/eu/etaxonomy/taxeditor/bulkeditor/referencingobjects/ReferencingObjectsView.java -text
 eu.etaxonomy.taxeditor.bulkeditor/src/main/java/eu/etaxonomy/taxeditor/dataimport/DataImportEditor.java -text
 eu.etaxonomy.taxeditor.bulkeditor/src/main/java/eu/etaxonomy/taxeditor/dataimport/DataImportEditorLineDisplayStrategy.java -text
-eu.etaxonomy.taxeditor.bulkeditor/src/main/java/eu/etaxonomy/taxeditor/dataimport/DataImportSpecimenEditorInput.java -text
+eu.etaxonomy.taxeditor.bulkeditor/src/main/java/eu/etaxonomy/taxeditor/dataimport/DerivedUnitEditorInput.java -text
 eu.etaxonomy.taxeditor.bulkeditor/src/main/java/eu/etaxonomy/taxeditor/dataimport/transientServices/TransientAgentService.java -text
 eu.etaxonomy.taxeditor.bulkeditor/src/main/java/eu/etaxonomy/taxeditor/dataimport/transientServices/TransientCdmRepository.java -text
 eu.etaxonomy.taxeditor.bulkeditor/src/main/java/eu/etaxonomy/taxeditor/dataimport/transientServices/TransientClassificationService.java -text
diff --git a/eu.etaxonomy.taxeditor.bulkeditor/src/main/java/eu/etaxonomy/taxeditor/annotatedlineeditor/AnnotatedLineDocumentProvider.java b/eu.etaxonomy.taxeditor.bulkeditor/src/main/java/eu/etaxonomy/taxeditor/annotatedlineeditor/AnnotatedLineDocumentProvider.java
index 64df8cf93..af7d40c9f 100644
--- a/eu.etaxonomy.taxeditor.bulkeditor/src/main/java/eu/etaxonomy/taxeditor/annotatedlineeditor/AnnotatedLineDocumentProvider.java
+++ b/eu.etaxonomy.taxeditor.bulkeditor/src/main/java/eu/etaxonomy/taxeditor/annotatedlineeditor/AnnotatedLineDocumentProvider.java
@@ -26,7 +26,7 @@ import org.eclipse.ui.IEditorInput;
 import org.eclipse.ui.texteditor.AbstractDocumentProvider;
 
 import eu.etaxonomy.taxeditor.bulkeditor.input.AbstractBulkEditorInput;
-import eu.etaxonomy.taxeditor.dataimport.DataImportSpecimenEditorInput;
+import eu.etaxonomy.taxeditor.dataimport.DerivedUnitEditorInput;
 import eu.etaxonomy.taxeditor.model.AbstractUtility;
 
 
@@ -219,8 +219,8 @@ public class AnnotatedLineDocumentProvider extends AbstractDocumentProvider {
 		if (element instanceof AbstractBulkEditorInput) {
 			return ((AbstractBulkEditorInput)element).getModel();
 		}
-		else if(element instanceof DataImportSpecimenEditorInput){
-		    return ((DataImportSpecimenEditorInput) element).getResults();
+		else if(element instanceof DerivedUnitEditorInput){
+		    return ((DerivedUnitEditorInput) element).getResults();
 		}
 		return null;
 	}
diff --git a/eu.etaxonomy.taxeditor.bulkeditor/src/main/java/eu/etaxonomy/taxeditor/dataimport/DataImportSpecimenEditorInput.java b/eu.etaxonomy.taxeditor.bulkeditor/src/main/java/eu/etaxonomy/taxeditor/dataimport/DataImportSpecimenEditorInput.java
deleted file mode 100644
index 4ef747b6c..000000000
--- a/eu.etaxonomy.taxeditor.bulkeditor/src/main/java/eu/etaxonomy/taxeditor/dataimport/DataImportSpecimenEditorInput.java
+++ /dev/null
@@ -1,165 +0,0 @@
-// $Id$
-/**
-* Copyright (C) 2013 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.dataimport;
-
-import java.io.IOException;
-import java.io.InputStream;
-import java.net.URISyntaxException;
-import java.util.List;
-
-import org.apache.http.client.ClientProtocolException;
-import org.apache.log4j.Logger;
-import org.eclipse.jface.resource.ImageDescriptor;
-import org.eclipse.ui.IEditorInput;
-import org.eclipse.ui.IPersistableElement;
-
-import eu.etaxonomy.cdm.ext.biocase.BioCaseQuery;
-import eu.etaxonomy.cdm.ext.biocase.BioCaseQueryServiceWrapper;
-import eu.etaxonomy.cdm.io.common.CdmDefaultImport;
-import eu.etaxonomy.cdm.io.specimen.abcd206.in.Abcd206ImportConfigurator;
-import eu.etaxonomy.cdm.model.occurrence.SpecimenOrObservationBase;
-import eu.etaxonomy.taxeditor.dataimport.transientServices.TransientCdmRepository;
-import eu.etaxonomy.taxeditor.store.CdmStore;
-
-/**
- * @author pplitzner
- * @date 20.09.2013
- *
- */
-public class DataImportSpecimenEditorInput implements IEditorInput {
-
-    private static Logger logger = Logger.getLogger(DataImportSpecimenEditorInput.class);
-
-    private BioCaseQuery query;
-
-    /**
-     * @param results
-     */
-    public DataImportSpecimenEditorInput(BioCaseQuery query) {
-        this.query = query;
-    }
-
-    /* (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 query.toString();
-    }
-
-    /* (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 query.toString();
-    }
-
-    /**
-     * @return the results
-     */
-    public List<SpecimenOrObservationBase> getResults() {
-        List<SpecimenOrObservationBase> results = null;
-        String errorMessage = "Could not execute query " + query;
-        try {
-            InputStream resultStream = new BioCaseQueryServiceWrapper().query(query);
-            Abcd206ImportConfigurator configurator = Abcd206ImportConfigurator.NewInstance(resultStream, null, false);
-            TransientCdmRepository repo = new TransientCdmRepository(CdmStore.getCurrentApplicationConfiguration());
-            configurator.setCdmAppController(repo);
-
-            CdmDefaultImport<Abcd206ImportConfigurator> importer = new CdmDefaultImport<Abcd206ImportConfigurator>();
-            importer.invoke(configurator);
-            results = repo.getUnits();
-//            Abcd206Import abcd206Import = new Abcd206Import();
-//            Abcd206ImportState state = new Abcd206ImportState(configurator);
-//            abcd206Import.invoke(state);
-//            state.countTrees();
-        } catch (ClientProtocolException e) {
-            logger.error(errorMessage, e);
-        } catch (IOException e) {
-            logger.error(errorMessage, e);
-        } catch (URISyntaxException e) {
-            logger.error(errorMessage, e);
-        }
-//        return new BioCaseQueryServiceWrapper().dummyData();
-        return results;
-    }
-
-    /* (non-Javadoc)
-     * @see java.lang.Object#hashCode()
-     */
-    @Override
-    public int hashCode() {
-        final int prime = 31;
-        int result = 1;
-        result = prime * result + ((query == null) ? 0 : query.hashCode());
-        return result;
-    }
-
-    /* (non-Javadoc)
-     * @see java.lang.Object#equals(java.lang.Object)
-     */
-    @Override
-    public boolean equals(Object obj) {
-        if (this == obj) {
-            return true;
-        }
-        if (obj == null) {
-            return false;
-        }
-        if (getClass() != obj.getClass()) {
-            return false;
-        }
-        DataImportSpecimenEditorInput other = (DataImportSpecimenEditorInput) obj;
-        if (query == null) {
-            if (other.query != null) {
-                return false;
-            }
-        } else if (!query.equals(other.query)) {
-            return false;
-        }
-        return true;
-    }
-
-}
diff --git a/eu.etaxonomy.taxeditor.bulkeditor/src/main/java/eu/etaxonomy/taxeditor/dataimport/DerivedUnitEditorInput.java b/eu.etaxonomy.taxeditor.bulkeditor/src/main/java/eu/etaxonomy/taxeditor/dataimport/DerivedUnitEditorInput.java
new file mode 100644
index 000000000..ef812ca0a
--- /dev/null
+++ b/eu.etaxonomy.taxeditor.bulkeditor/src/main/java/eu/etaxonomy/taxeditor/dataimport/DerivedUnitEditorInput.java
@@ -0,0 +1,171 @@
+// $Id$
+/**
+* Copyright (C) 2013 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.dataimport;
+
+import java.io.IOException;
+import java.io.InputStream;
+import java.net.URISyntaxException;
+import java.util.ArrayList;
+import java.util.List;
+
+import org.apache.http.client.ClientProtocolException;
+import org.apache.log4j.Logger;
+import org.eclipse.jface.resource.ImageDescriptor;
+import org.eclipse.ui.IEditorInput;
+import org.eclipse.ui.IPersistableElement;
+
+import eu.etaxonomy.cdm.ext.biocase.BioCaseQuery;
+import eu.etaxonomy.cdm.ext.biocase.BioCaseQueryServiceWrapper;
+import eu.etaxonomy.cdm.io.common.CdmDefaultImport;
+import eu.etaxonomy.cdm.io.specimen.abcd206.in.Abcd206ImportConfigurator;
+import eu.etaxonomy.cdm.model.occurrence.SpecimenOrObservationBase;
+import eu.etaxonomy.taxeditor.dataimport.transientServices.TransientCdmRepository;
+import eu.etaxonomy.taxeditor.store.CdmStore;
+
+/**
+ * @author pplitzner
+ * @date 20.09.2013
+ *
+ */
+public class DerivedUnitEditorInput implements IEditorInput {
+
+    private static Logger logger = Logger.getLogger(DerivedUnitEditorInput.class);
+
+    private final BioCaseQuery query;
+
+    private List<SpecimenOrObservationBase> results;
+
+    /**
+     * @param results
+     */
+    public DerivedUnitEditorInput(BioCaseQuery query) {
+        this.query = query;
+        results = new ArrayList<SpecimenOrObservationBase>();
+    }
+
+    /* (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 query.toString();
+    }
+
+    /* (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 query.toString();
+    }
+
+    /**
+     * @return the results
+     */
+    public List<SpecimenOrObservationBase> getResults() {
+        if(results!=null && !results.isEmpty()){
+            return results;
+        }
+        String errorMessage = "Could not execute query " + query;
+        try {
+            InputStream resultStream = new BioCaseQueryServiceWrapper().query(query);
+            Abcd206ImportConfigurator configurator = Abcd206ImportConfigurator.NewInstance(resultStream, null, false);
+            TransientCdmRepository repo = new TransientCdmRepository(CdmStore.getCurrentApplicationConfiguration());
+            configurator.setCdmAppController(repo);
+
+            CdmDefaultImport<Abcd206ImportConfigurator> importer = new CdmDefaultImport<Abcd206ImportConfigurator>();
+            importer.invoke(configurator);
+            results = repo.getUnits();
+//            Abcd206Import abcd206Import = new Abcd206Import();
+//            Abcd206ImportState state = new Abcd206ImportState(configurator);
+//            abcd206Import.invoke(state);
+//            state.countTrees();
+        } catch (ClientProtocolException e) {
+            logger.error(errorMessage, e);
+        } catch (IOException e) {
+            logger.error(errorMessage, e);
+        } catch (URISyntaxException e) {
+            logger.error(errorMessage, e);
+        }
+//        return new BioCaseQueryServiceWrapper().dummyData();
+        return results;
+    }
+
+    /* (non-Javadoc)
+     * @see java.lang.Object#hashCode()
+     */
+    @Override
+    public int hashCode() {
+        final int prime = 31;
+        int result = 1;
+        result = prime * result + ((query == null) ? 0 : query.hashCode());
+        return result;
+    }
+
+    /* (non-Javadoc)
+     * @see java.lang.Object#equals(java.lang.Object)
+     */
+    @Override
+    public boolean equals(Object obj) {
+        if (this == obj) {
+            return true;
+        }
+        if (obj == null) {
+            return false;
+        }
+        if (getClass() != obj.getClass()) {
+            return false;
+        }
+        DerivedUnitEditorInput other = (DerivedUnitEditorInput) obj;
+        if (query == null) {
+            if (other.query != null) {
+                return false;
+            }
+        } else if (!query.equals(other.query)) {
+            return false;
+        }
+        return true;
+    }
+
+}
diff --git a/eu.etaxonomy.taxeditor.bulkeditor/src/main/java/eu/etaxonomy/taxeditor/dataimport/transientServices/TransientTaxonService.java b/eu.etaxonomy.taxeditor.bulkeditor/src/main/java/eu/etaxonomy/taxeditor/dataimport/transientServices/TransientTaxonService.java
index 6c76d93fb..1cb2b6d99 100644
--- a/eu.etaxonomy.taxeditor.bulkeditor/src/main/java/eu/etaxonomy/taxeditor/dataimport/transientServices/TransientTaxonService.java
+++ b/eu.etaxonomy.taxeditor.bulkeditor/src/main/java/eu/etaxonomy/taxeditor/dataimport/transientServices/TransientTaxonService.java
@@ -29,9 +29,10 @@ import eu.etaxonomy.cdm.api.service.TaxaAndNamesSearchMode;
 import eu.etaxonomy.cdm.api.service.config.IFindTaxaAndNamesConfigurator;
 import eu.etaxonomy.cdm.api.service.config.IIdentifiableEntityServiceConfigurator;
 import eu.etaxonomy.cdm.api.service.config.MatchingTaxonConfigurator;
+import eu.etaxonomy.cdm.api.service.config.SynonymDeletionConfigurator;
 import eu.etaxonomy.cdm.api.service.config.TaxonDeletionConfigurator;
+import eu.etaxonomy.cdm.api.service.exception.DataChangeNoRollbackException;
 import eu.etaxonomy.cdm.api.service.exception.HomotypicalGroupChangeException;
-import eu.etaxonomy.cdm.api.service.exception.ReferencedObjectUndeletableException;
 import eu.etaxonomy.cdm.api.service.pager.Pager;
 import eu.etaxonomy.cdm.api.service.search.LuceneMultiSearchException;
 import eu.etaxonomy.cdm.api.service.search.SearchResult;
@@ -86,7 +87,7 @@ import eu.etaxonomy.cdm.strategy.merge.IMergeStrategy;
  */
 public class TransientTaxonService implements ITaxonService {
 
-    private ITaxonService defaultTaxonService;
+    private final ITaxonService defaultTaxonService;
 
     /**
      * @param defaultTaxonService
@@ -734,17 +735,6 @@ public class TransientTaxonService implements ITaxonService {
         return null;
     }
 
-    /**
-     * @param taxon
-     * @param config
-     * @throws ReferencedObjectUndeletableException
-     * @see eu.etaxonomy.cdm.api.service.ITaxonService#deleteTaxon(eu.etaxonomy.cdm.model.taxon.Taxon, eu.etaxonomy.cdm.api.service.config.TaxonDeletionConfigurator)
-     */
-    @Override
-    public void deleteTaxon(Taxon taxon, TaxonDeletionConfigurator config) throws ReferencedObjectUndeletableException {
-        defaultTaxonService.deleteTaxon(taxon, config);
-    }
-
     /**
      * @param transientObject
      * @return
@@ -1271,18 +1261,6 @@ public class TransientTaxonService implements ITaxonService {
         return defaultTaxonService.deleteSynonymRelationships(syn);
     }
 
-    /**
-     * @param synonym
-     * @param taxon
-     * @param removeNameIfPossible
-     * @param newHomotypicGroupIfNeeded
-     * @see eu.etaxonomy.cdm.api.service.ITaxonService#deleteSynonym(eu.etaxonomy.cdm.model.taxon.Synonym, eu.etaxonomy.cdm.model.taxon.Taxon, boolean, boolean)
-     */
-    @Override
-    public void deleteSynonym(Synonym synonym, Taxon taxon, boolean removeNameIfPossible, boolean newHomotypicGroupIfNeeded) {
-        defaultTaxonService.deleteSynonym(synonym, taxon, removeNameIfPossible, newHomotypicGroupIfNeeded);
-    }
-
     /**
      * @param taxonBase
      * @param type
@@ -1382,6 +1360,31 @@ public class TransientTaxonService implements ITaxonService {
         return defaultTaxonService.createAllInferredSynonyms(taxon, tree, doWithMisappliedNames);
     }
 
+    /* (non-Javadoc)
+     * @see eu.etaxonomy.cdm.api.service.ITaxonService#deleteSynonym(eu.etaxonomy.cdm.model.taxon.Synonym, eu.etaxonomy.cdm.api.service.config.SynonymDeletionConfigurator)
+     */
+    @Override
+    public void deleteSynonym(Synonym arg0, SynonymDeletionConfigurator arg1) {
+        defaultTaxonService.deleteSynonym(arg0, arg1);
+    }
+
+    /* (non-Javadoc)
+     * @see eu.etaxonomy.cdm.api.service.ITaxonService#deleteSynonym(eu.etaxonomy.cdm.model.taxon.Synonym, eu.etaxonomy.cdm.model.taxon.Taxon, eu.etaxonomy.cdm.api.service.config.SynonymDeletionConfigurator)
+     */
+    @Override
+    public void deleteSynonym(Synonym arg0, Taxon arg1, SynonymDeletionConfigurator arg2) {
+        defaultTaxonService.deleteSynonym(arg0, arg1, arg2);
+    }
+
+    /* (non-Javadoc)
+     * @see eu.etaxonomy.cdm.api.service.ITaxonService#deleteTaxon(eu.etaxonomy.cdm.model.taxon.Taxon, eu.etaxonomy.cdm.api.service.config.TaxonDeletionConfigurator, eu.etaxonomy.cdm.model.taxon.Classification)
+     */
+    @Override
+    public void deleteTaxon(Taxon arg0, TaxonDeletionConfigurator arg1, Classification arg2)
+            throws DataChangeNoRollbackException {
+        defaultTaxonService.deleteTaxon(arg0, arg1, arg2);
+    }
+
 
 
 }
diff --git a/eu.etaxonomy.taxeditor.bulkeditor/src/main/java/eu/etaxonomy/taxeditor/dataimport/wizard/SpecimenSearchWizard.java b/eu.etaxonomy.taxeditor.bulkeditor/src/main/java/eu/etaxonomy/taxeditor/dataimport/wizard/SpecimenSearchWizard.java
index 2923b3b36..62642019a 100644
--- a/eu.etaxonomy.taxeditor.bulkeditor/src/main/java/eu/etaxonomy/taxeditor/dataimport/wizard/SpecimenSearchWizard.java
+++ b/eu.etaxonomy.taxeditor.bulkeditor/src/main/java/eu/etaxonomy/taxeditor/dataimport/wizard/SpecimenSearchWizard.java
@@ -20,7 +20,7 @@ import org.eclipse.ui.PlatformUI;
 
 import eu.etaxonomy.cdm.ext.biocase.BioCaseQuery;
 import eu.etaxonomy.taxeditor.dataimport.DataImportEditor;
-import eu.etaxonomy.taxeditor.dataimport.DataImportSpecimenEditorInput;
+import eu.etaxonomy.taxeditor.dataimport.DerivedUnitEditorInput;
 import eu.etaxonomy.taxeditor.store.CdmStore;
 
 /**
@@ -56,7 +56,7 @@ public class SpecimenSearchWizard extends Wizard implements IImportWizard {
 
         try {
             query = searchPage.getQuery();
-            DataImportSpecimenEditorInput input = new DataImportSpecimenEditorInput(query);
+            DerivedUnitEditorInput input = new DerivedUnitEditorInput(query);
             page.openEditor(input, DataImportEditor.ID, true);
         } catch ( PartInitException e ) {
             //Put your exception handler here if you wish to
diff --git a/eu.etaxonomy.taxeditor.editor/src/main/java/eu/etaxonomy/taxeditor/editor/view/derivate/DerivateContentProvider.java b/eu.etaxonomy.taxeditor.editor/src/main/java/eu/etaxonomy/taxeditor/editor/view/derivate/DerivateContentProvider.java
index 47c5d234a..37d5e7f2f 100644
--- a/eu.etaxonomy.taxeditor.editor/src/main/java/eu/etaxonomy/taxeditor/editor/view/derivate/DerivateContentProvider.java
+++ b/eu.etaxonomy.taxeditor.editor/src/main/java/eu/etaxonomy/taxeditor/editor/view/derivate/DerivateContentProvider.java
@@ -1,10 +1,18 @@
 package eu.etaxonomy.taxeditor.editor.view.derivate;
 
+import java.util.ArrayList;
 import java.util.Collections;
+import java.util.List;
+import java.util.Set;
 
 import org.eclipse.jface.viewers.ITreeContentProvider;
 import org.eclipse.jface.viewers.Viewer;
 
+import eu.etaxonomy.cdm.model.occurrence.DerivationEvent;
+import eu.etaxonomy.cdm.model.occurrence.DerivedUnit;
+import eu.etaxonomy.cdm.model.occurrence.FieldUnit;
+import eu.etaxonomy.cdm.model.occurrence.SpecimenOrObservationBase;
+
 public class DerivateContentProvider implements ITreeContentProvider {
 
 	@Override
@@ -19,24 +27,63 @@ public class DerivateContentProvider implements ITreeContentProvider {
 
 	@Override
 	public Object[] getElements(Object inputElement) {
-		return Collections.singleton(inputElement).toArray();
+	    // return the parent FieldUnit if element is a DerivedUnit
+	    if(inputElement instanceof DerivedUnit){
+	        DerivedUnit derivedUnit = (DerivedUnit)inputElement;
+	        for(SpecimenOrObservationBase original:derivedUnit.getOriginals()){
+	          if(original instanceof FieldUnit){
+	              return Collections.singletonList(original).toArray();
+	          }
+	          else{
+	              return getElements(original);
+	          }
+	        }
+	    }
+	    // return the FieldUnit itself if element is a FieldUnit (used clone() due to recursion issues -> see javadoc of this method)
+	    else if(inputElement instanceof FieldUnit){
+	        FieldUnit fieldUnit = ((FieldUnit) inputElement).clone();
+	        fieldUnit.getTitleCache();
+	        return Collections.singleton(fieldUnit).toArray();
+	    }
+		return Collections.EMPTY_LIST.toArray();
 	}
 
 	@Override
 	public Object[] getChildren(Object parentElement) {
-		return null;
+	    if(parentElement instanceof SpecimenOrObservationBase){
+	        return getDerivates((SpecimenOrObservationBase) parentElement).toArray();
+	    }
+	    return null;
 	}
 
 	@Override
 	public Object getParent(Object element) {
-		// TODO Auto-generated method stub
+	    if(element instanceof DerivedUnit){
+	        DerivedUnit derivedUnit = (DerivedUnit)element;
+	        return derivedUnit.getOriginalUnit();
+	    }
 		return null;
 	}
 
 	@Override
 	public boolean hasChildren(Object element) {
-		// TODO Auto-generated method stub
+	    if(element instanceof SpecimenOrObservationBase){
+	        SpecimenOrObservationBase specimenOrObservation = (SpecimenOrObservationBase)element;
+	        for(DerivationEvent event:(Set<DerivationEvent>)specimenOrObservation.getDerivationEvents()){
+	            if(!event.getDerivatives().isEmpty()){
+	                return true;
+	            }
+	        }
+	    }
 		return false;
 	}
 
+	private List<DerivedUnit> getDerivates(SpecimenOrObservationBase specimenOrObservation){
+	    List<DerivedUnit> derivates = new ArrayList<DerivedUnit>();
+	    for(DerivationEvent derivationEvent:(Set<DerivationEvent>)specimenOrObservation.getDerivationEvents()){
+	        derivates.addAll(derivationEvent.getDerivatives());
+	    }
+	    return derivates;
+	}
+
 }
diff --git a/eu.etaxonomy.taxeditor.editor/src/main/java/eu/etaxonomy/taxeditor/editor/view/derivate/DerivateView.java b/eu.etaxonomy.taxeditor.editor/src/main/java/eu/etaxonomy/taxeditor/editor/view/derivate/DerivateView.java
index da6c9c079..ce5036414 100644
--- a/eu.etaxonomy.taxeditor.editor/src/main/java/eu/etaxonomy/taxeditor/editor/view/derivate/DerivateView.java
+++ b/eu.etaxonomy.taxeditor.editor/src/main/java/eu/etaxonomy/taxeditor/editor/view/derivate/DerivateView.java
@@ -11,6 +11,7 @@ import org.eclipse.ui.IWorkbenchPart;
 
 import eu.etaxonomy.cdm.model.common.CdmBase;
 import eu.etaxonomy.taxeditor.bulkeditor.BulkEditor;
+import eu.etaxonomy.taxeditor.model.AbstractUtility;
 import eu.etaxonomy.taxeditor.model.IPartContentHasDetails;
 import eu.etaxonomy.taxeditor.model.IPartContentHasSupplementalData;
 import eu.etaxonomy.taxeditor.view.AbstractCdmEditorViewPart;
@@ -38,12 +39,12 @@ public class DerivateView extends AbstractCdmEditorViewPart implements IPartCont
 
 	@Override
 	public void selectionChanged(IWorkbenchPart part, ISelection selection) {
-	    if(part instanceof BulkEditor && selection instanceof IStructuredSelection){
-	        showViewer(part, (IStructuredSelection)selection);
+	    if(AbstractUtility.getActiveEditor()==null || !(AbstractUtility.getActiveEditor() instanceof BulkEditor)){
+	        showEmptyPage();
 	        return;
 	    }
-	    else {
-	        showEmptyPage();
+	    else if(part instanceof BulkEditor && selection instanceof IStructuredSelection){
+	        showViewer(part, (IStructuredSelection)selection);
 	        return;
 	    }
 	}
