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
This commit is contained in:
Vladimir Lagunov
2021-02-01 10:00:32 +00:00
committed by intellij-monorepo-bot
parent 79546e8d48
commit 5b1ca6e07e
@@ -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();