void (MenuSelectionManager msm, MouseEvent e) { // Auditory cue if (!isInternalFrameSystemMenu()) { @NonNls ActionMap map = menuItem.getActionMap(); if (map != null) { Action audioAction = map.get(getPropertyPrefix() + ".commandSound"); if (audioAction != null) { // pass off firing the Action to a utility method BasicLookAndFeel lf = (BasicLookAndFeel)UIManager.getLookAndFeel(); // It's a hack. The method BasicLookAndFeel.playSound has protected access, so // it's impossible to normally invoke it. try { Method playSoundMethod = BasicLookAndFeel.class.getDeclaredMethod(PLAY_SOUND_METHOD, Action.class); playSoundMethod.setAccessible(true); playSoundMethod.invoke(lf, audioAction); } catch (Exception ignored) { } } } } // Visual feedback if (msm == null) { msm = MenuSelectionManager.defaultManager(); } ActionMenuItem item = (ActionMenuItem)menuItem; AnAction action = item.getAnAction(); if (ActionPlaces.MAIN_MENU.equals(item.place) && ApplicationManager.getApplication() != null) { MainMenuCollector.getInstance().record(action); } if (!item.isKeepMenuOpen()) { msm.clearSelectedPath(); } ActionEvent event = new ActionEvent(menuItem, ActionEvent.ACTION_PERFORMED, null, e.getWhen(), e.getModifiers()); item.fireActionPerformed(event); if (item.isKeepMenuOpen()) { Container parent = item.getParent(); if (parent instanceof JComponent) { //Fake event to trigger update in ActionPopupMenuImpl.MyMenu ((JComponent)parent).putClientProperty(KEEP_MENU_OPEN_PROP, System.currentTimeMillis()); } } }