void (final AnActionEvent e) { final DefaultActionGroup group = new DefaultActionGroup(); fillActions(group); if (group.getChildrenCount() == 1 && isSilentlyChooseSingleOption()) { final AnAction[] children = group.getChildren(null); children[0].actionPerformed(e); return; } if (group.getChildrenCount() == 0) { group.add(new AnAction(getTextForEmpty()) { @Override public void actionPerformed(@NotNull AnActionEvent e) { group.setPopup(false); } } ); } final DataContext context = e.getDataContext(); final ListPopup popup = JBPopupFactory.getInstance() .createActionGroupPopup(getCaption(), group, context, JBPopupFactory.ActionSelectionAid.SPEEDSEARCH, true); JComponent contextComponent = null; InputEvent inputEvent = e.getInputEvent(); if (inputEvent instanceof MouseEvent) { if (inputEvent.getSource() instanceof JComponent) { contextComponent = (JComponent)inputEvent.getSource(); } } showPopup(context, popup, contextComponent); }