void (Editor editor) { ActionManager actionManager = ActionManager.getInstance(); AnAction group = actionManager.getAction(IdeActions.GROUP_EDITOR_BIDI_TEXT_DIRECTION); if (group instanceof ActionGroup) { JPopupMenu popupMenu = actionManager.createActionPopupMenu(ActionPlaces.MAIN_MENU, (ActionGroup)group).getComponent(); AWTEvent event = IdeEventQueue.getInstance().getTrueCurrentEvent(); if (event instanceof MouseEvent && ((MouseEvent)event).getComponent().isShowing()) { JBPopupMenu.showByEvent((MouseEvent)event, popupMenu); } else { JBPopupMenu.showByEditor(editor, popupMenu); } } }