コード例 #1
0
 public MyActionGroupWrapper(final ActionGroup actionGroup) {
   super(
       actionGroup.getTemplatePresentation().getText(),
       actionGroup.getTemplatePresentation().getDescription(),
       actionGroup.getTemplatePresentation().getIcon());
   myActionGroup = actionGroup;
   registerCustomShortcutSet(actionGroup.getShortcutSet(), myTree);
 }
コード例 #2
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);
   }
 }