commit e1fa7fbe2c592da0b7297508d1e1a192437b9d6d
Author: Patrick Plitzner <p.plitzner@bgbm.org>
Date:   Mon May 22 16:06:18 2017 +0200

    fix #6669 Refresh context menu before it is drawn

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 00bcc23f1..510d01d49 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
@@ -147,6 +147,7 @@ public class ReferencingObjectsView extends AbstractCdmViewPart {
         getSite().registerContextMenu(menuManager, viewer);
         Control control = viewer.getControl();
         Menu menu = menuManager.createContextMenu(control);
+        menuManager.setRemoveAllWhenShown(true);
         control.setMenu(menu);
 
         // Propagate selection from viewer
diff --git a/eu.etaxonomy.taxeditor.editor/src/main/java/eu/etaxonomy/taxeditor/editor/view/concept/ConceptViewPart.java b/eu.etaxonomy.taxeditor.editor/src/main/java/eu/etaxonomy/taxeditor/editor/view/concept/ConceptViewPart.java
index 79e9985d3..a4b8ff6f9 100644
--- a/eu.etaxonomy.taxeditor.editor/src/main/java/eu/etaxonomy/taxeditor/editor/view/concept/ConceptViewPart.java
+++ b/eu.etaxonomy.taxeditor.editor/src/main/java/eu/etaxonomy/taxeditor/editor/view/concept/ConceptViewPart.java
@@ -47,7 +47,7 @@ import eu.etaxonomy.taxeditor.view.supplementaldata.SupplementalDataViewPart;
  * @created Jan 24, 2011
  * @version 1.0
  */
-public class ConceptViewPart extends AbstractCdmEditorViewPart 
+public class ConceptViewPart extends AbstractCdmEditorViewPart
 implements IPartContentHasDetails, IPartContentHasSupplementalData{
 
 	public static final String ID = "eu.etaxonomy.taxeditor.editor.view.concept"; //$NON-NLS-1$
@@ -63,7 +63,7 @@ implements IPartContentHasDetails, IPartContentHasSupplementalData{
 			showEmptyPage();
 			return;
 		}
-		
+
         if (part instanceof DetailsViewPart || part instanceof SupplementalDataViewPart) {
             // do not show empty page as these views are also used to edit the
             // description selected in this view
@@ -93,7 +93,7 @@ implements IPartContentHasDetails, IPartContentHasSupplementalData{
 		}
 
 	}
-	
+
 	@Override
 	protected String createPartTitle(Object selectedObject) {
 		if(selectedObject instanceof TaxonEditorInput){
@@ -135,6 +135,7 @@ implements IPartContentHasDetails, IPartContentHasSupplementalData{
 
 		Control control = viewer.getControl();
 		Menu menu = menuManager.createContextMenu(control);
+		menuManager.setRemoveAllWhenShown(true);
 
 		control.setMenu(menu);
 	}
@@ -149,8 +150,8 @@ implements IPartContentHasDetails, IPartContentHasSupplementalData{
 
 		public ConceptRelationViewer(Composite parent) {
 			super(parent);
-		} 
-		
+		}
+
 		@Override
 		public ISelection getSelection() {
 			ISelection selection = super.getSelection();
@@ -158,11 +159,11 @@ implements IPartContentHasDetails, IPartContentHasSupplementalData{
 				Object firstElement = ((IStructuredSelection) selection).getFirstElement();
 				TaxonRelationship taxonRelationship = ((Entry<TaxonRelationship, Taxon>)firstElement).getKey();
 				return new StructuredSelection(taxonRelationship);
-				
+
 			}
 			return selection;
 		}
-		
+
 		@Override
 		public void setSelection(ISelection selection) {
 			super.setSelection(selection);
diff --git a/eu.etaxonomy.taxeditor.editor/src/main/java/eu/etaxonomy/taxeditor/editor/view/media/MediaViewPart.java b/eu.etaxonomy.taxeditor.editor/src/main/java/eu/etaxonomy/taxeditor/editor/view/media/MediaViewPart.java
index ae339497d..1572119d5 100644
--- a/eu.etaxonomy.taxeditor.editor/src/main/java/eu/etaxonomy/taxeditor/editor/view/media/MediaViewPart.java
+++ b/eu.etaxonomy.taxeditor.editor/src/main/java/eu/etaxonomy/taxeditor/editor/view/media/MediaViewPart.java
@@ -71,6 +71,7 @@ public class MediaViewPart extends AbstractCdmEditorViewPart implements IPartCon
 
 		Control control = viewer.getControl();
 		Menu menu = menuMgr.createContextMenu(control);
+		menuMgr.setRemoveAllWhenShown(true);
 		control.setMenu(menu);
 
 	}
@@ -136,7 +137,7 @@ public class MediaViewPart extends AbstractCdmEditorViewPart implements IPartCon
 	        ((BulkEditor) part).forceDirty();
 	        IStructuredSelection selection = (IStructuredSelection) ((BulkEditor) part).getSelectionProvider().getSelection();
             ((BulkEditor) part).changed(selection.getFirstElement());
-            
+
 	    }
 	    super.changed(object);
 	}
diff --git a/eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/editor/definedterm/DefinedTermEditor.java b/eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/editor/definedterm/DefinedTermEditor.java
index 08bcce217..4c2a95689 100644
--- a/eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/editor/definedterm/DefinedTermEditor.java
+++ b/eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/editor/definedterm/DefinedTermEditor.java
@@ -138,6 +138,7 @@ public class DefinedTermEditor extends EditorPart implements IConversationEnable
 
 		Control control = viewer.getControl();
 		Menu menu = menuManager.createContextMenu(control);
+		menuManager.setRemoveAllWhenShown(true);
 		control.setMenu(menu);
 	}
 
