Skip to main content
summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorOlivier Constant2018-09-24 05:28:32 -0400
committerOlivier Constant2018-09-24 05:28:32 -0400
commit6235ff1f7b84b66be2371c2b060f83a97133daa3 (patch)
tree6d5cb9c2d01e9e375037cc1850dfa1313d6d0f2f
parent7e92ae00dbe7172362355e36df8b25fe95399d00 (diff)
downloadorg.eclipse.emf.diffmerge.core-6235ff1f7b84b66be2371c2b060f83a97133daa3.tar.gz
org.eclipse.emf.diffmerge.core-6235ff1f7b84b66be2371c2b060f83a97133daa3.tar.xz
org.eclipse.emf.diffmerge.core-6235ff1f7b84b66be2371c2b060f83a97133daa3.zip
Fixed double display of "Link views" drop-down menu
Change-Id: Ib1f540c1380a6c7566f88e8288db5629f19190df Signed-off-by: Olivier Constant <olivier.constant@thalesgroup.com>
-rw-r--r--plugins/org.eclipse.emf.diffmerge.ui/src/org/eclipse/emf/diffmerge/ui/util/UIUtil.java6
-rw-r--r--plugins/org.eclipse.emf.diffmerge.ui/src/org/eclipse/emf/diffmerge/ui/viewers/ComparisonViewer.java4
2 files changed, 7 insertions, 3 deletions
diff --git a/plugins/org.eclipse.emf.diffmerge.ui/src/org/eclipse/emf/diffmerge/ui/util/UIUtil.java b/plugins/org.eclipse.emf.diffmerge.ui/src/org/eclipse/emf/diffmerge/ui/util/UIUtil.java
index 07886574..1ab8e650 100644
--- a/plugins/org.eclipse.emf.diffmerge.ui/src/org/eclipse/emf/diffmerge/ui/util/UIUtil.java
+++ b/plugins/org.eclipse.emf.diffmerge.ui/src/org/eclipse/emf/diffmerge/ui/util/UIUtil.java
@@ -405,7 +405,11 @@ public final class UIUtil {
* @see org.eclipse.jface.action.IMenuCreator#getMenu(org.eclipse.swt.widgets.Menu)
*/
public Menu getMenu(Menu parent_p) {
- _menuManager.fill(parent_p, -1);
+ Menu existingMenu = _menuManager.getMenu();
+ if (existingMenu == null || existingMenu.isDisposed()) {
+ Menu containerMenu = new Menu(parent_p); // Not to be shown
+ _menuManager.fill(containerMenu, -1); // Contribution mechanism will issue copy items
+ }
return _menuManager.getMenu();
}
/**
diff --git a/plugins/org.eclipse.emf.diffmerge.ui/src/org/eclipse/emf/diffmerge/ui/viewers/ComparisonViewer.java b/plugins/org.eclipse.emf.diffmerge.ui/src/org/eclipse/emf/diffmerge/ui/viewers/ComparisonViewer.java
index 8009864d..d4b7554d 100644
--- a/plugins/org.eclipse.emf.diffmerge.ui/src/org/eclipse/emf/diffmerge/ui/viewers/ComparisonViewer.java
+++ b/plugins/org.eclipse.emf.diffmerge.ui/src/org/eclipse/emf/diffmerge/ui/viewers/ComparisonViewer.java
@@ -1268,10 +1268,10 @@ public class ComparisonViewer extends AbstractComparisonViewer {
final MenuDropDownAction action = new MenuDropDownAction();
action.setText(Messages.ComparisonViewer_LinkViews);
action.setImageDescriptor(getImageDescriptor(ImageID.SYNCED));
- ActionContributionItem result = new ActionContributionItem(action);
- context_p.add(result);
createItemSyncInternal(action.getMenuManager());
createItemSyncExternal(action.getMenuManager());
+ ActionContributionItem result = new ActionContributionItem(action);
+ context_p.add(result);
return result;
}

Back to the top