public void actionPerformed(AnActionEvent e) { final JBPopupFactory popupFactory = JBPopupFactory.getInstance(); final ListPopupStep step = popupFactory.createActionsStep( myActionGroup, e.getDataContext(), false, false, myActionGroup.getTemplatePresentation().getText(), myTree, true, myPreselection != null ? myPreselection.getDefaultIndex() : 0, true); final ListPopup listPopup = popupFactory.createListPopup(step); listPopup.setHandleAutoSelectionBeforeShow(true); if (e instanceof AnActionButton.AnActionEventWrapper) { ((AnActionButton.AnActionEventWrapper) e).showPopup(listPopup); } else { listPopup.showUnderneathOf(myNorthPanel); } }
public MyActionGroupWrapper(final ActionGroupWithPreselection actionGroup) { this(actionGroup.getActionGroup()); myPreselection = actionGroup; }