IDEA-222902 IDEA-235581 revert of 4753b0f

GitOrigin-RevId: 4686c4f6445c1f09f3abaf3ba1cbf15400b08e9e
This commit is contained in:
Dmitry.Krasilschikov
2020-03-22 20:31:53 +00:00
committed by intellij-monorepo-bot
parent 4a18157bf6
commit 91aa330fa2
@@ -276,7 +276,7 @@ public class PopupFactoryImpl extends JBPopupFactory {
List<ActionItem> 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<DataContext> 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<DataContext> 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);
}