コード例 #1
0
 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);
   }
 }
コード例 #2
0
 public MyActionGroupWrapper(final ActionGroupWithPreselection actionGroup) {
   this(actionGroup.getActionGroup());
   myPreselection = actionGroup;
 }