commit 11329eccd6f400d8a738607fb5c5eab2413e0fd1
Author: Katja Luther <k.luther@bgbm.org>
Date:   Thu Jan 29 10:58:33 2015 +0000

    factual data for bulkeditor, improving referencing objects view, make delete in bulkeditor visible for synonyms

diff --git a/eu.etaxonomy.taxeditor.bulkeditor/plugin.xml b/eu.etaxonomy.taxeditor.bulkeditor/plugin.xml
index cb64bf7b3..fc783f268 100644
--- a/eu.etaxonomy.taxeditor.bulkeditor/plugin.xml
+++ b/eu.etaxonomy.taxeditor.bulkeditor/plugin.xml
@@ -169,7 +169,7 @@
                visible="true">
          </separator>
          <command
-               commandId="org.eclipse.ui.edit.delete"
+               commandId="eu.etaxonomy.taxeditor.bulkeditor.delete"
                label="Delete"
                style="push">
             <visibleWhen
@@ -228,6 +228,10 @@
             id="taxeditor-bulkeditor.command.setMarkerFlag"
             name="Set Marker Flag">
       </command>
+      <command
+            id="eu.etaxonomy.taxeditor.bulkeditor.delete"
+            name="delete">
+      </command>
       <!--command
             defaultHandler="eu.etaxonomy.taxeditor.bulkeditor.handler.NewEntityHandler"
             id="eu.etaxonomy.taxeditor.bulkeditor.command.new"
@@ -360,7 +364,7 @@
       </handler>
       <handler
             class="eu.etaxonomy.taxeditor.bulkeditor.handler.DeleteHandler"
-            commandId="org.eclipse.ui.edit.delete">
+            commandId="eu.etaxonomy.taxeditor.bulkeditor.delete">
          <activeWhen>
             <with
                   variable="selection">
diff --git a/eu.etaxonomy.taxeditor.bulkeditor/src/main/java/eu/etaxonomy/taxeditor/bulkeditor/BulkEditor.java b/eu.etaxonomy.taxeditor.bulkeditor/src/main/java/eu/etaxonomy/taxeditor/bulkeditor/BulkEditor.java
index c05e3483c..44c8ce7b6 100644
--- a/eu.etaxonomy.taxeditor.bulkeditor/src/main/java/eu/etaxonomy/taxeditor/bulkeditor/BulkEditor.java
+++ b/eu.etaxonomy.taxeditor.bulkeditor/src/main/java/eu/etaxonomy/taxeditor/bulkeditor/BulkEditor.java
@@ -48,6 +48,8 @@ import eu.etaxonomy.taxeditor.bulkeditor.referencingobjects.ReferencingObjectsVi
 import eu.etaxonomy.taxeditor.model.IDerivedUnitFacadePart;
 import eu.etaxonomy.taxeditor.model.IDirtyMarkable;
 import eu.etaxonomy.taxeditor.model.IPartContentHasDetails;
+import eu.etaxonomy.taxeditor.model.IPartContentHasFactualData;
+
 import eu.etaxonomy.taxeditor.preference.PreferencesUtil;
 import eu.etaxonomy.taxeditor.store.CdmStore;
 
@@ -61,7 +63,7 @@ import eu.etaxonomy.taxeditor.store.CdmStore;
  * @version 1.0
  */
 public class BulkEditor extends AnnotatedLineEditor implements IPartContentHasDetails,
-        IDirtyMarkable, IDerivedUnitFacadePart {
+        IDirtyMarkable, IDerivedUnitFacadePart, IPartContentHasFactualData {
 
 	/** Constant <code>ID="bulkeditor.editor"</code> */
 	public static final String ID = "bulkeditor.editor";
@@ -173,6 +175,7 @@ public class BulkEditor extends AnnotatedLineEditor implements IPartContentHasDe
 		}
 		super.dispose();
 	}
+	
 
 	/* (non-Javadoc)
 	 * @see org.eclipse.ui.texteditor.AbstractDecoratedTextEditor#isEditable()
diff --git a/eu.etaxonomy.taxeditor.bulkeditor/src/main/java/eu/etaxonomy/taxeditor/bulkeditor/handler/DeleteHandler.java b/eu.etaxonomy.taxeditor.bulkeditor/src/main/java/eu/etaxonomy/taxeditor/bulkeditor/handler/DeleteHandler.java
index 8f87f7d2b..95c415566 100644
--- a/eu.etaxonomy.taxeditor.bulkeditor/src/main/java/eu/etaxonomy/taxeditor/bulkeditor/handler/DeleteHandler.java
+++ b/eu.etaxonomy.taxeditor.bulkeditor/src/main/java/eu/etaxonomy/taxeditor/bulkeditor/handler/DeleteHandler.java
@@ -21,6 +21,7 @@ import org.eclipse.ui.IEditorInput;
 import org.eclipse.ui.IEditorPart;
 import org.eclipse.ui.IViewPart;
 import org.eclipse.ui.IViewReference;
+import org.eclipse.ui.PlatformUI;
 import org.eclipse.ui.handlers.HandlerUtil;
 import org.eclipse.ui.texteditor.IDocumentProvider;
 import org.eclipse.ui.IWorkbenchPage;
@@ -33,6 +34,7 @@ import eu.etaxonomy.cdm.api.service.IOccurrenceService;
 import eu.etaxonomy.cdm.api.service.IReferenceService;
 import eu.etaxonomy.cdm.api.service.ITaxonService;
 import eu.etaxonomy.cdm.api.service.IUserService;
+import eu.etaxonomy.cdm.api.service.config.NameDeletionConfigurator;
 import eu.etaxonomy.cdm.model.agent.TeamOrPersonBase;
 import eu.etaxonomy.cdm.model.common.Group;
 import eu.etaxonomy.cdm.model.common.User;
@@ -56,6 +58,7 @@ import eu.etaxonomy.taxeditor.preference.IPreferenceKeys;
 import eu.etaxonomy.taxeditor.preference.PreferencesUtil;
 import eu.etaxonomy.taxeditor.store.CdmStore;
 
+
 /**
  * @author n.hoffmann
  * @created Mar 11, 2011
@@ -87,6 +90,11 @@ public class DeleteHandler extends AbstractHandler {
 				IStructuredSelection structuredSelection = (IStructuredSelection) selection;
 				
 				IEntityPersistenceService persistenceService = (IEntityPersistenceService) input;
+				 IViewPart part = PlatformUI.getWorkbench().getActiveWorkbenchWindow().getActivePage()
+						    .findView("eu.etaxonomy.taxeditor.bulkeditor.view.referencingobjects");
+				    if (part != null){
+						((ReferencingObjectsView)part).dispose();
+					}
 				
 				for(Object object : structuredSelection.toList()){
 					
@@ -116,8 +124,10 @@ public class DeleteHandler extends AbstractHandler {
 							result = service.delete((User) object);
 						} else if (object instanceof TaxonNameBase){
 							INameService service = controller.getNameService();
-							service.load(((TaxonNameBase) object).getUuid());
-							result = service.delete((TaxonNameBase)object);
+							TaxonNameBase name = service.load(((TaxonNameBase) object).getUuid());
+							NameDeletionConfigurator config = new NameDeletionConfigurator();
+							
+							result = service.delete(name, config);
 						} else if (object instanceof TaxonBase){
 							ITaxonService service = controller.getTaxonService();
 							service.load(((TaxonBase) object).getUuid());
@@ -134,7 +144,7 @@ public class DeleteHandler extends AbstractHandler {
 					} catch (Exception e){
 						MessagingUtils.messageDialog("Exception occured. Could not delete", getClass(), e.getMessage(), null);
 					}
-					if (result.isError() || !result.getExceptions().isEmpty()){
+					if (result.isError() || result.isAbort()|| !result.getExceptions().isEmpty()){
 						if (!result.getExceptions().isEmpty()) {
 							MessagingUtils.messageDialog("Could not delete", getClass(), result.getExceptions().get(0).getMessage(), null);
 						}else{
@@ -144,8 +154,17 @@ public class DeleteHandler extends AbstractHandler {
 					}
 					if (result.isOk() && result.getExceptions().isEmpty()){
 						((BulkEditor) editor).removeAnnotatedLine(annotation);
+						
 
 					}
+					if (part != null){
+						((ReferencingObjectsView)part).refresh();
+					}
+					part = PlatformUI.getWorkbench().getActiveWorkbenchWindow().getActivePage()
+						    .findView("eu.etaxonomy.taxeditor.editor.view.descriptive");
+				    if (part != null){
+						//((DescriptiveViewPart)part).dispose();
+					}
 				}				
 			}
 		}else{
diff --git a/eu.etaxonomy.taxeditor.bulkeditor/src/main/java/eu/etaxonomy/taxeditor/bulkeditor/input/TaxonEditorInput.java b/eu.etaxonomy.taxeditor.bulkeditor/src/main/java/eu/etaxonomy/taxeditor/bulkeditor/input/TaxonEditorInput.java
index 92b9023ee..3367a5e09 100644
--- a/eu.etaxonomy.taxeditor.bulkeditor/src/main/java/eu/etaxonomy/taxeditor/bulkeditor/input/TaxonEditorInput.java
+++ b/eu.etaxonomy.taxeditor.bulkeditor/src/main/java/eu/etaxonomy/taxeditor/bulkeditor/input/TaxonEditorInput.java
@@ -1,5 +1,6 @@
 package eu.etaxonomy.taxeditor.bulkeditor.input;
 
+import java.util.ArrayList;
 import java.util.Arrays;
 import java.util.List;
 import java.util.UUID;
@@ -10,7 +11,10 @@ import eu.etaxonomy.cdm.api.service.config.FindTaxaAndNamesConfiguratorImpl;
 import eu.etaxonomy.cdm.api.service.config.IFindTaxaAndNamesConfigurator;
 import eu.etaxonomy.cdm.api.service.config.IIdentifiableEntityServiceConfigurator;
 import eu.etaxonomy.cdm.api.service.exception.ReferencedObjectUndeletableException;
+import eu.etaxonomy.cdm.hibernate.HibernateProxyHelper;
 import eu.etaxonomy.cdm.model.name.TaxonNameBase;
+import eu.etaxonomy.cdm.model.taxon.Synonym;
+import eu.etaxonomy.cdm.model.taxon.Taxon;
 import eu.etaxonomy.cdm.model.taxon.TaxonBase;
 import eu.etaxonomy.cdm.persistence.query.MatchMode;
 import eu.etaxonomy.taxeditor.annotatedlineeditor.IEntityCreator;
@@ -24,6 +28,8 @@ public class TaxonEditorInput extends AbstractBulkEditorInput<TaxonBase>{
 	/** Constant <code>ID="bulkeditor.input.taxon"</code> */
 	public static final String ID = "bulkeditor.input.taxon";
 	
+	
+	
 	/**
 	 * <p>Getter for the field <code>instance</code>.</p>
 	 *
@@ -33,6 +39,7 @@ public class TaxonEditorInput extends AbstractBulkEditorInput<TaxonBase>{
 		if (instance == null) {
 			instance = new TaxonEditorInput();
 		}
+	
 		return instance;
 	}
 	
@@ -78,8 +85,17 @@ public class TaxonEditorInput extends AbstractBulkEditorInput<TaxonBase>{
 		IFindTaxaAndNamesConfigurator<TaxonBase> newConfig = new FindTaxaAndNamesConfiguratorImpl<TaxonBase>();
 		newConfig.setTitleSearchString(configurator.getTitleSearchStringSqlized());
 		newConfig.setMatchMode(MatchMode.ANYWHERE);
-		
-		return CdmStore.getSearchManager().findTaxa(configurator);
+		List<TaxonBase> taxa =  CdmStore.getSearchManager().findTaxa(configurator);
+		List<TaxonBase> taxaCopy = new ArrayList<TaxonBase>();
+		for (TaxonBase taxon:taxa){
+			
+			if (taxon instanceof Taxon){
+				taxaCopy.add(HibernateProxyHelper.deproxy(taxon, Taxon.class));
+			}else{
+				taxaCopy.add(HibernateProxyHelper.deproxy(taxon, Synonym.class));
+			}
+		}
+		return taxaCopy;
 	}
 
 
diff --git a/eu.etaxonomy.taxeditor.bulkeditor/src/main/java/eu/etaxonomy/taxeditor/bulkeditor/referencingobjects/ReferencingObjectsView.java b/eu.etaxonomy.taxeditor.bulkeditor/src/main/java/eu/etaxonomy/taxeditor/bulkeditor/referencingobjects/ReferencingObjectsView.java
index f4d15b146..0c1280ad8 100644
--- a/eu.etaxonomy.taxeditor.bulkeditor/src/main/java/eu/etaxonomy/taxeditor/bulkeditor/referencingobjects/ReferencingObjectsView.java
+++ b/eu.etaxonomy.taxeditor.bulkeditor/src/main/java/eu/etaxonomy/taxeditor/bulkeditor/referencingobjects/ReferencingObjectsView.java
@@ -1,9 +1,9 @@
 // $Id$
 /**
 * 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.
 */
@@ -15,25 +15,49 @@ import java.util.Collections;
 import java.util.Comparator;
 import java.util.List;
 import java.util.Set;
+import java.util.UUID;
 
 import org.apache.log4j.Logger;
+import org.eclipse.core.runtime.IProgressMonitor;
+import org.eclipse.core.runtime.IStatus;
+import org.eclipse.core.runtime.Status;
+import org.eclipse.core.runtime.jobs.Job;
 import org.eclipse.jface.viewers.ISelection;
 import org.eclipse.jface.viewers.IStructuredSelection;
 import org.eclipse.jface.viewers.TableViewer;
 import org.eclipse.jface.viewers.TableViewerColumn;
 import org.eclipse.jface.viewers.Viewer;
 import org.eclipse.swt.SWT;
+import org.eclipse.swt.internal.ole.win32.ISpecifyPropertyPages;
 import org.eclipse.swt.widgets.Composite;
 import org.eclipse.swt.widgets.Display;
 import org.eclipse.swt.widgets.Table;
 import org.eclipse.ui.INullSelectionListener;
+import org.eclipse.ui.ISelectionListener;
 import org.eclipse.ui.IWorkbenchPart;
 
+import eu.etaxonomy.cdm.api.conversation.ConversationHolder;
 import eu.etaxonomy.cdm.api.service.IAgentService;
 import eu.etaxonomy.cdm.api.service.ICommonService;
+import eu.etaxonomy.cdm.api.service.IGroupService;
+import eu.etaxonomy.cdm.api.service.IIdentifiableEntityService;
+import eu.etaxonomy.cdm.api.service.INameService;
+import eu.etaxonomy.cdm.api.service.IOccurrenceService;
+import eu.etaxonomy.cdm.api.service.IReferenceService;
+import eu.etaxonomy.cdm.api.service.ITaxonService;
+import eu.etaxonomy.cdm.api.service.IUserService;
+import eu.etaxonomy.cdm.model.agent.AgentBase;
 import eu.etaxonomy.cdm.model.agent.TeamOrPersonBase;
 import eu.etaxonomy.cdm.model.common.CdmBase;
+import eu.etaxonomy.cdm.model.common.Group;
+import eu.etaxonomy.cdm.model.common.ICdmBase;
 import eu.etaxonomy.cdm.model.common.IdentifiableEntity;
+import eu.etaxonomy.cdm.model.common.User;
+import eu.etaxonomy.cdm.model.name.TaxonNameBase;
+import eu.etaxonomy.cdm.model.occurrence.SpecimenOrObservationBase;
+import eu.etaxonomy.cdm.model.reference.Reference;
+import eu.etaxonomy.cdm.model.taxon.TaxonBase;
+import eu.etaxonomy.cdm.persistence.dao.agent.IAgentDao;
 import eu.etaxonomy.taxeditor.bulkeditor.BulkEditor;
 import eu.etaxonomy.taxeditor.model.DescriptionHelper;
 import eu.etaxonomy.taxeditor.model.LineSelection;
@@ -53,11 +77,11 @@ public class ReferencingObjectsView extends AbstractCdmViewPart implements INull
 
 	/** Constant <code>ID="eu.etaxonomy.taxeditor.bulkeditor.refer"{trunked}</code> */
 	public static final String ID = "eu.etaxonomy.taxeditor.bulkeditor.view.referencingobjects";
-
+	
 	private TableViewer viewer;
 
-	private CdmBase referencedObject;
-
+	private String referencedObjectTitleCache;
+	
 	/* (non-Javadoc)
 	 * @see eu.etaxonomy.taxeditor.model.AbstractCdmViewPart#createViewer(org.eclipse.swt.widgets.Composite)
 	 */
@@ -65,7 +89,7 @@ public class ReferencingObjectsView extends AbstractCdmViewPart implements INull
 	@Override
 	public void createViewer(Composite parent) {
 		selectionService.addSelectionListener(this);
-
+		
 		viewer = new TableViewer(parent, SWT.MULTI | SWT.H_SCROLL
 				| SWT.V_SCROLL | SWT.FULL_SELECTION);
 		createColumns(viewer);
@@ -73,7 +97,7 @@ public class ReferencingObjectsView extends AbstractCdmViewPart implements INull
 		viewer.setLabelProvider(new ReferencingObjectsLabelProvider());
 //		viewer.setInput(new ArrayList<CdmBase>());
 	}
-
+	
 	/**
 	 * Create the columns for the table
 	 * @param viewer
@@ -99,72 +123,87 @@ public class ReferencingObjectsView extends AbstractCdmViewPart implements INull
 	 *
 	 * @param entity a {@link eu.etaxonomy.cdm.model.common.IdentifiableEntity} object.
 	 */
-	public void updateReferencingObjects(final IdentifiableEntity entity) {
-
+	public void updateReferencingObjects(final UUID entityUUID, final Class objectClass) {
+		
 		final Display display = Display.getCurrent();
-
-		//TODO see ticket #4537 (Re-enable asynchronous loading for ReferencingObjectsView)
-		//this is a workaround for #1569
-		//Job job = new Job("Update Referencing Objects") {
-//
-//			@Override
-//			protected IStatus run(IProgressMonitor monitor) {
-//				monitor.beginTask("Calculating referencing objects", 10);
-//
-//				monitor.worked(3);
-//
-//				display.asyncExec(new Runnable() {
-//
-//					@Override
-//					public void run() {
-//						ConversationHolder conversation = CdmStore.createConversation();
-						List<CdmBase> referencingObjects = getReferencingObjects(entity);
-						updateView(referencingObjects);
-//						conversation.close();
-//					}
-//				});
-//
-//				monitor.done();
-//
-//
-//				return Status.OK_STATUS;
-//			}
-//		};
-//
-//		job.setPriority(Job.DECORATE);
-//		job.schedule();
+		
+		Job job = new Job("Update Referencing Objects") {
+			
+			@Override
+			protected IStatus run(IProgressMonitor monitor) {
+				monitor.beginTask("Calculating referencing objects", 10);
+			
+				monitor.worked(3);
+				
+				display.asyncExec(new Runnable() {
+					
+					@Override
+					public void run() {
+						if (entityUUID != null){
+							ConversationHolder conversation = CdmStore.createConversation();
+							List<CdmBase> referencingObjects = getReferencingObjects(entityUUID, objectClass);
+							conversation.close();
+							updateView(referencingObjects);
+						}
+					}
+				});
+				
+				monitor.done();
+				
+				
+				return Status.OK_STATUS;
+			}
+		};
+		
+		job.setPriority(Job.DECORATE);
+		job.schedule();
 	}
 
-	private List<CdmBase> getReferencingObjects(Object entity) {
+	private List<CdmBase> getReferencingObjects(UUID entity, Class objectClass) {
+		CdmBase referencedObject = null;
         try {
-        	if(entity instanceof CdmBase){
-	        	referencedObject = (CdmBase) entity;
-	        	if (referencedObject instanceof TeamOrPersonBase){
-	        		referencedObject = CdmStore.getService(IAgentService.class).load(referencedObject.getUuid());
-	        	}
+        	if (objectClass.getSuperclass().equals(TeamOrPersonBase.class) ){
+	        	referencedObject = CdmStore.getService(IAgentService.class).load(entity);
+        	} else if (objectClass.getSuperclass().equals(TaxonNameBase.class)){
+        		referencedObject = CdmStore.getService(INameService.class).load(entity);
+        	} else if (objectClass.getSuperclass().equals(TaxonBase.class)){
+        		referencedObject = CdmStore.getService(ITaxonService.class).load(entity);
+        	} else if (objectClass.getSuperclass().equals(Reference.class)){
+        		referencedObject = CdmStore.getService(IReferenceService.class).load(entity);
+        	} else if (objectClass.getSuperclass().equals(SpecimenOrObservationBase.class)){
+        		referencedObject = CdmStore.getService(IOccurrenceService.class).load(entity);
+        	} else if (objectClass.isAssignableFrom(User.class)){
+        		referencedObject = CdmStore.getService(IUserService.class).load(entity);
+        	} else if (objectClass.isAssignableFrom(Group.class)){
+        		referencedObject = CdmStore.getService(IGroupService.class).load(entity);
+        	}
 	        	//referencedObject =(CdmBase) CdmStore.getService(IIdentifiableEntityService.class).load(referencedObject.getUuid());
-	        	Set<CdmBase> setOfReferencingObjects = CdmStore.getService(ICommonService.class).getReferencingObjects(referencedObject);
-	        	if (setOfReferencingObjects != null){
-		        	List<CdmBase> referencingObjects = new ArrayList<CdmBase>(setOfReferencingObjects);
-
-		    		Collections.sort(referencingObjects, new ReferencingClassComparator());
-
-		    		return referencingObjects;
-	        	}
+        	Set<CdmBase> setOfReferencingObjects = null;
+        	
+        	if (referencedObject != null){
+        		referencedObjectTitleCache = ((IdentifiableEntity)referencedObject).getTitleCache();
+        		setOfReferencingObjects = CdmStore.getService(ICommonService.class).getReferencingObjects(referencedObject);
+        	}
+	        if (setOfReferencingObjects != null){
+		       	List<CdmBase> referencingObjects = new ArrayList<CdmBase>(setOfReferencingObjects);	        	
+		       	
+		    	Collections.sort(referencingObjects, new ReferencingClassComparator());
+		    		
+		    	return referencingObjects;
+	        	
         	}
         } catch (Exception e) {
             logger.error("Error retrieving referencing objects", e);
         }
 		return null;
 	}
-
+	
 	class ReferencingClassComparator implements Comparator<CdmBase> {
 
 		/* (non-Javadoc)
 		 * @see java.util.Comparator#compare(java.lang.Object, java.lang.Object)
 		 */
-		@Override
-        public int compare(CdmBase o1, CdmBase o2) {
+		public int compare(CdmBase o1, CdmBase o2) {
 			String string1 = o1.getClass().getSimpleName();
 			String string2 = o2.getClass().getSimpleName();
 			int classCompare = string1.compareToIgnoreCase(string2);
@@ -177,44 +216,46 @@ public class ReferencingObjectsView extends AbstractCdmViewPart implements INull
 			}
 		}
 	}
-
+	
 	/**
-	 *
+	 * 
 	 */
 	private void updateView(List<CdmBase> referencingObjects) {
-		viewer.setInput(referencingObjects);
-		setContentDescription("'" + referencedObject + "' is referenced by:");
-		showViewer();
+		if (viewer != null && !viewer.getControl().isDisposed()){
+			viewer.setInput(referencingObjects);
+			/*if (referencedObjectTitleCache != null){
+				setContentDescription("'" + referencedObjectTitleCache + "' is referenced by:");
+			} else {
+				setContentDescription("");
+			}*/
+			showViewer();
+		}
 	}
 
 	/** {@inheritDoc} */
-	@Override
-    public void selectionChanged(IWorkbenchPart part, ISelection selection) {
-	    if(part==null){
-	        return;
-	    }
+	public void selectionChanged(IWorkbenchPart part, ISelection selection) {
 		if(! (part instanceof BulkEditor)){
 			setContentDescription("");
 			showEmptyPage();
 			return;
 		}
-
+		
 		if(! (selection instanceof LineSelection)){
 			return;
 		}
 		LineSelection lineSelection = (LineSelection) selection;
-
+		
 		if(lineSelection.size() != 1){
 			return;
 		}
-
+			
 		if(! (lineSelection.getFirstElement() instanceof IdentifiableEntity)){
 			return;
 		}
-
+		
 		showViewer(part, lineSelection);
 	}
-
+	
 	/* (non-Javadoc)
 	 * @see eu.etaxonomy.taxeditor.model.AbstractCdmViewPart#showViewer(org.eclipse.ui.IWorkbenchPart, org.eclipse.jface.viewers.ISelection)
 	 */
@@ -222,17 +263,17 @@ public class ReferencingObjectsView extends AbstractCdmViewPart implements INull
 	@Override
 	public void showViewer(IWorkbenchPart part, IStructuredSelection selection) {
 		this.part = part;
-
-		updateReferencingObjects((IdentifiableEntity) selection.getFirstElement());
+		
+		updateReferencingObjects(((IdentifiableEntity) selection.getFirstElement()).getUuid(),selection.getFirstElement().getClass() );
 	}
-
+	
 	/** {@inheritDoc} */
 	@Override
 	public void dispose() {
 		selectionService.removePostSelectionListener(this);
 		selectionService.removeSelectionListener(this);
 		super.dispose();
-
+		
 	}
 
 	/* (non-Javadoc)
@@ -252,7 +293,7 @@ public class ReferencingObjectsView extends AbstractCdmViewPart implements INull
 	public void changed(Object object) {
 		// no editing in this view
 	}
-
+	
 	/* (non-Javadoc)
 	 * @see eu.etaxonomy.taxeditor.operations.IPostOperationEnabled#onComplete()
 	 */
@@ -261,13 +302,13 @@ public class ReferencingObjectsView extends AbstractCdmViewPart implements INull
 	public boolean onComplete() {
 		return false;
 	}
-
+	
 	public void refresh(){
 		selectionService.removePostSelectionListener(this);
 		selectionService.removeSelectionListener(this);
 		selectionService.addPostSelectionListener(this);
 		selectionService.addSelectionListener(this);
-
+		
 	}
 
 
diff --git a/eu.etaxonomy.taxeditor.editor/src/main/java/eu/etaxonomy/taxeditor/editor/name/TaxonNameEditor.java b/eu.etaxonomy.taxeditor.editor/src/main/java/eu/etaxonomy/taxeditor/editor/name/TaxonNameEditor.java
index c622997aa..24ea70f11 100644
--- a/eu.etaxonomy.taxeditor.editor/src/main/java/eu/etaxonomy/taxeditor/editor/name/TaxonNameEditor.java
+++ b/eu.etaxonomy.taxeditor.editor/src/main/java/eu/etaxonomy/taxeditor/editor/name/TaxonNameEditor.java
@@ -653,6 +653,7 @@ public class TaxonNameEditor extends EditorPart implements
 	/** {@inheritDoc} */
 	@Override
 	public void dispose() {
+		conversation.unregisterForDataStoreChanges(this);
 		super.dispose();
 	}
 
diff --git a/eu.etaxonomy.taxeditor.editor/src/main/java/eu/etaxonomy/taxeditor/editor/view/descriptive/DescriptiveViewPart.java b/eu.etaxonomy.taxeditor.editor/src/main/java/eu/etaxonomy/taxeditor/editor/view/descriptive/DescriptiveViewPart.java
index c9320f109..5660e6bb6 100644
--- a/eu.etaxonomy.taxeditor.editor/src/main/java/eu/etaxonomy/taxeditor/editor/view/descriptive/DescriptiveViewPart.java
+++ b/eu.etaxonomy.taxeditor.editor/src/main/java/eu/etaxonomy/taxeditor/editor/view/descriptive/DescriptiveViewPart.java
@@ -49,6 +49,7 @@ import eu.etaxonomy.cdm.model.description.IDescribable;
 import eu.etaxonomy.cdm.model.description.IndividualsAssociation;
 import eu.etaxonomy.cdm.model.occurrence.SpecimenOrObservationBase;
 import eu.etaxonomy.cdm.model.taxon.Taxon;
+import eu.etaxonomy.taxeditor.bulkeditor.BulkEditor;
 import eu.etaxonomy.taxeditor.editor.EditorUtil;
 import eu.etaxonomy.taxeditor.editor.view.checklist.ChecklistEditor;
 import eu.etaxonomy.taxeditor.editor.view.derivate.DerivateView;
@@ -137,7 +138,7 @@ public class DescriptiveViewPart extends AbstractCdmEditorViewPart implements IP
                             EditorUtil.open(new DerivateViewEditorInput(Collections.singleton(specimen.getUuid())));
                         } catch (PartInitException e) {
                             MessagingUtils.error(DescriptiveViewPart.class, "Could not open Derivate Editor", e);
-                        }
+	}
                     }
 
 
@@ -229,7 +230,7 @@ public class DescriptiveViewPart extends AbstractCdmEditorViewPart implements IP
         }
 		if(selection instanceof IStructuredSelection
 		        && ((IStructuredSelection) selection).getFirstElement() instanceof IDescribable<?>
-		        && part instanceof IPartContentHasFactualData){
+		        && part instanceof IPartContentHasFactualData  && !(((IStructuredSelection) selection).getFirstElement() instanceof SpecimenOrObservationBase && part instanceof BulkEditor)){
 		    featureNodeContainerCache.clear();
 		    showViewer(part, (IStructuredSelection) selection);
 		    return;
@@ -307,6 +308,9 @@ public class DescriptiveViewPart extends AbstractCdmEditorViewPart implements IP
 			StructuredSelection selection = new StructuredSelection(object);
 			viewer.setSelection(selection, true);
 		}
+		if(part instanceof BulkEditor && !(object instanceof SpecimenOrObservationBase<?>)){
+		    ((BulkEditor) part).forceDirty();
+		}
 
 		super.changed(object);
 	}
diff --git a/eu.etaxonomy.taxeditor.editor/src/main/java/eu/etaxonomy/taxeditor/editor/view/descriptive/handler/CreateDescriptionHandler.java b/eu.etaxonomy.taxeditor.editor/src/main/java/eu/etaxonomy/taxeditor/editor/view/descriptive/handler/CreateDescriptionHandler.java
index 2f3392406..0d743e102 100644
--- a/eu.etaxonomy.taxeditor.editor/src/main/java/eu/etaxonomy/taxeditor/editor/view/descriptive/handler/CreateDescriptionHandler.java
+++ b/eu.etaxonomy.taxeditor.editor/src/main/java/eu/etaxonomy/taxeditor/editor/view/descriptive/handler/CreateDescriptionHandler.java
@@ -13,6 +13,7 @@ import org.eclipse.core.commands.AbstractHandler;
 import org.eclipse.core.commands.ExecutionEvent;
 import org.eclipse.core.commands.ExecutionException;
 import org.eclipse.core.commands.common.NotDefinedException;
+import org.eclipse.core.expressions.EvaluationContext;
 import org.eclipse.ui.IEditorInput;
 import org.eclipse.ui.IEditorPart;
 import org.eclipse.ui.IWorkbenchPart;
@@ -21,6 +22,7 @@ import org.eclipse.ui.handlers.HandlerUtil;
 
 import eu.etaxonomy.cdm.model.occurrence.SpecimenOrObservationBase;
 import eu.etaxonomy.cdm.model.taxon.Taxon;
+import eu.etaxonomy.cdm.model.taxon.TaxonBase;
 import eu.etaxonomy.taxeditor.editor.EditorUtil;
 import eu.etaxonomy.taxeditor.editor.TaxonEditorInput;
 import eu.etaxonomy.taxeditor.editor.view.descriptive.DescriptiveViewPart;
@@ -77,6 +79,15 @@ public class CreateDescriptionHandler extends AbstractHandler {
 		            MessagingUtils.warn(getClass(), "Command name not set.");
 		        }
 		    }
+		    if(viewerInput instanceof TaxonBase){
+		    	try{
+		    		operation = createTaxonOperation(event.getCommand().getName(), (Taxon) viewerInput, postOperationEnabled);
+		            AbstractUtility.executeOperation(operation);
+		    	 } catch (NotDefinedException e) {
+			            MessagingUtils.warn(getClass(), "Command name not set.");
+			     }
+		        
+		    }
 		}
 		return null;
 	}
diff --git a/eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/view/detail/DetailsViewPart.java b/eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/view/detail/DetailsViewPart.java
index d544df5fb..cd780fc68 100644
--- a/eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/view/detail/DetailsViewPart.java
+++ b/eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/view/detail/DetailsViewPart.java
@@ -116,8 +116,9 @@ public class DetailsViewPart extends AbstractCdmEditorViewPart implements IPartC
 	/** {@inheritDoc} */
 	@Override
 	public void dispose() {
-		super.dispose();
 		selectionService.removePostSelectionListener(this);
+		super.dispose();
+		
 	}
 
 	/**
