From db132dc4baa5833865f6a919078c0c26e871b748 Mon Sep 17 00:00:00 2001 From: Andrey Loskutov Date: Tue, 13 Feb 2024 17:56:02 +0100 Subject: [PATCH] Revert "Allow asynchronous creation of menus in ActionContributionItem" This reverts commit 771d0b405910c4971123ffb46b09b9693d10af4e. See https://github.com/eclipse-platform/eclipse.platform/issues/1202 See https://github.com/eclipse-jdt/eclipse.jdt.ui/issues/1068 --- .../jface/action/ActionContributionItem.java | 17 ----------------- 1 file changed, 17 deletions(-) diff --git a/bundles/org.eclipse.jface/src/org/eclipse/jface/action/ActionContributionItem.java b/bundles/org.eclipse.jface/src/org/eclipse/jface/action/ActionContributionItem.java index 4cf97d6044e..86658a03a55 100644 --- a/bundles/org.eclipse.jface/src/org/eclipse/jface/action/ActionContributionItem.java +++ b/bundles/org.eclipse.jface/src/org/eclipse/jface/action/ActionContributionItem.java @@ -15,8 +15,6 @@ *******************************************************************************/ package org.eclipse.jface.action; -import java.util.Arrays; - import org.eclipse.core.commands.ExecutionException; import org.eclipse.core.commands.NotEnabledException; import org.eclipse.jface.action.ExternalActionManager.IBindingManagerCallback; @@ -1170,22 +1168,7 @@ private void handleShowProxy(Menu proxy) { if (holdMenu == null) { return; } - - // for backwards compatibility (in case the menu is NOT calculated asynchronously) copyMenu(holdMenu, proxy); - - // in case the menu is populated asynchronously by the menu creator, this listener will update it once it's complete - holdMenu.addListener(SWT.Show, evt -> { - // This one is (currently) being triggered from ContextuaLaunchAction - if (evt.data == null || evt.data != holdMenu) - return; - - // remove all items in the proxy... - Arrays.stream(proxy.getItems()).forEach(Widget::dispose); - - // ... and replace them with the new content - copyMenu(holdMenu, proxy); - }); } /**