@Override
      public void actionPerformed(@NotNull AnActionEvent e) {
        ListPopup actionGroupPopup = JBPopupFactory.getInstance().
          createActionGroupPopup(null, actions, e.getDataContext(), true, null, Integer.MAX_VALUE);

        HelpTooltip.setMasterPopup(e.getInputEvent().getComponent(), actionGroupPopup);
        Component component = toolbarComponent.getComponent(0);

        Container dialogComponent = ((JComponent)component).getRootPane().getParent();
        if (dialogComponent != null) {
          ComponentAdapter listener = new ComponentAdapter() {
            @Override
            public void componentResized(ComponentEvent e) {
              movePopup();
            }

            @Override
            public void componentMoved(ComponentEvent e) {
              movePopup();
            }

            private void movePopup() {
              if (actionGroupPopup.isVisible()) {
                actionGroupPopup.setLocation(new RelativePoint(component, getPopupPoint()).getScreenPoint());
                actionGroupPopup.pack(true, true);
              }
            }
          };
          dialogComponent.addComponentListener(listener);
          actionGroupPopup.addListener(new JBPopupListener() {
            @Override
            public void onClosed(@NotNull LightweightWindowEvent event) {
              dialogComponent.removeComponentListener(listener);
            }
          });
        }

        actionGroupPopup.show(new RelativePoint(component, getPopupPoint()));
      }
@Override
      public void actionPerformed(@NotNull AnActionEvent e)