Skip to content

Commit

Permalink
Revert "Allow asynchronous creation of menus in ActionContributionItem"
Browse files Browse the repository at this point in the history
  • Loading branch information
iloveeclipse committed Feb 13, 2024
1 parent a0d2262 commit 1f7f07a
Showing 1 changed file with 0 additions and 17 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -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);
});
}

/**
Expand Down

0 comments on commit 1f7f07a

Please sign in to comment.