From 5b1ca6e07e4fecd96b3fdd7b9094acdb4f392cc8 Mon Sep 17 00:00:00 2001 From: Vladimir Lagunov Date: Mon, 1 Feb 2021 13:55:40 +0700 Subject: [PATCH] Revert commits in ActionToolbarImpl which have been causing SOE. Reverts: * 61d456edcb7a8b6b4f95144a1ec1ca8b9a07efec * 06a9a8943d004f64e55b4fec7b19ba2c7fe886f7 * fdb66569a8d9f2fdbcfd5377503ce29d527b2522 Must fix: EA-222974 EA-251427 EA-252007 Breaks back: DS-709 GitOrigin-RevId: 6e20e4b7d51bf2a4726c30345150ba1e5a235a09 --- .../actionSystem/impl/ActionToolbarImpl.java | 20 ++----------------- 1 file changed, 2 insertions(+), 18 deletions(-) diff --git a/platform/platform-impl/src/com/intellij/openapi/actionSystem/impl/ActionToolbarImpl.java b/platform/platform-impl/src/com/intellij/openapi/actionSystem/impl/ActionToolbarImpl.java index 18e280194fd3..8f8bbd73cc85 100644 --- a/platform/platform-impl/src/com/intellij/openapi/actionSystem/impl/ActionToolbarImpl.java +++ b/platform/platform-impl/src/com/intellij/openapi/actionSystem/impl/ActionToolbarImpl.java @@ -34,7 +34,6 @@ import com.intellij.util.ui.*; import com.intellij.util.ui.update.Activatable; import com.intellij.util.ui.update.UiNotifyConnector; import org.intellij.lang.annotations.MagicConstant; -import org.jetbrains.annotations.NonNls; import org.jetbrains.annotations.NotNull; import org.jetbrains.annotations.Nullable; import org.jetbrains.annotations.TestOnly; @@ -1238,11 +1237,7 @@ public class ActionToolbarImpl extends JPanel implements ActionToolbar, QuickAct group = outside; } - final class AutoPopupToolbar extends PopupToolbar implements DataProvider { - private AutoPopupToolbar(@NotNull String place, @NotNull ActionGroup actionGroup, boolean horizontal, @NotNull JComponent parent) { - super(place, actionGroup, horizontal, parent); - } - + PopupToolbar popupToolbar = new PopupToolbar(myPlace, group, true, this) { @Override protected void onOtherActionPerformed() { hidePopup(); @@ -1252,18 +1247,7 @@ public class ActionToolbarImpl extends JPanel implements ActionToolbar, QuickAct protected @NotNull DataContext getDataContext() { return ActionToolbarImpl.this.getDataContext(); } - - @Override - public @Nullable Object getData(@NotNull @NonNls String dataId) { - // Prevent recursion like in EA-239860 that might happen when ActionToolbar is reattached to the new popup as a child component. - if (ActionToolbarImpl.this.getDataContext().getData(PlatformDataKeys.CONTEXT_COMPONENT) != this) { - return ActionToolbarImpl.this.getDataContext().getData(dataId); - } - return null; - } - } - - PopupToolbar popupToolbar = new AutoPopupToolbar(myPlace, group, true, this); + }; popupToolbar.setLayoutPolicy(NOWRAP_LAYOUT_POLICY); popupToolbar.updateActionsImmediately();