From 91aa330fa21da5cb2e877a572d4fc5e387eb5cfa Mon Sep 17 00:00:00 2001 From: "Dmitry.Krasilschikov" Date: Sun, 22 Mar 2020 22:07:50 +0200 Subject: [PATCH] IDEA-222902 IDEA-235581 revert of 4753b0f GitOrigin-RevId: 4686c4f6445c1f09f3abaf3ba1cbf15400b08e9e --- .../com/intellij/ui/popup/PopupFactoryImpl.java | 14 ++++---------- 1 file changed, 4 insertions(+), 10 deletions(-) diff --git a/platform/platform-impl/src/com/intellij/ui/popup/PopupFactoryImpl.java b/platform/platform-impl/src/com/intellij/ui/popup/PopupFactoryImpl.java index ab164933b4f9..0f04e474da4b 100644 --- a/platform/platform-impl/src/com/intellij/ui/popup/PopupFactoryImpl.java +++ b/platform/platform-impl/src/com/intellij/ui/popup/PopupFactoryImpl.java @@ -276,7 +276,7 @@ public class PopupFactoryImpl extends JBPopupFactory { List items = ActionPopupStep.createActionItems( actionGroup, dataContext, showNumbers, useAlphaAsNumbers, showDisabledActions, honorActionMnemonics, actionPlace, presentationFactory); - return new ActionPopupStep(items, title, getComponentContextSupplier(dataContext, component), actionPlace, showNumbers || honorActionMnemonics && itemsHaveMnemonics(items), + return new ActionPopupStep(items, title, getComponentContextSupplier(component), actionPlace, showNumbers || honorActionMnemonics && itemsHaveMnemonics(items), preselectActionCondition, autoSelection, showDisabledActions, presentationFactory); } @@ -353,14 +353,8 @@ public class PopupFactoryImpl extends JBPopupFactory { } @NotNull - private static Supplier getComponentContextSupplier(@NotNull DataContext dataContext, Component component) { - return () -> { - DataContext componentContext = DataManager.getInstance().getDataContext(component); - return (DataContext)dataId -> { - Object data = dataContext.getData(dataId); - return data != null ? data : componentContext.getData(dataId); - }; - }; + private static Supplier getComponentContextSupplier(Component component) { + return () -> DataManager.getInstance().getDataContext(component); } @Override @@ -417,7 +411,7 @@ public class PopupFactoryImpl extends JBPopupFactory { return ActionPopupStep.createActionsStep( actionGroup, dataContext, showNumbers, true, showDisabledActions, title, honorActionMnemonics, autoSelectionEnabled, - getComponentContextSupplier(dataContext, component), + getComponentContextSupplier(component), actionPlace, null, defaultOptionIndex, null); }