/** * Information extraction for entries in the menu * * @param source source of the action */ private void analyzeActionMenuItem(ActionMenuItem source) { mySource = ActionSource.MENU_ENTRY; myDescription = source.getText(); myMnemonic = source.getMnemonic(); final Field actionField = findActionField(source, ActionRef.class); if (actionField != null) { try { final ActionRef o = (ActionRef) actionField.get(source); final AnAction action = o.getAction(); if (action != null) { fixValuesFromAction(action); } } catch (Exception e) { // happens.. } } }
public ActionMenu(final DataContext context, @NotNull final String place, final ActionGroup group, final PresentationFactory presentationFactory, final boolean enableMnemonics, final boolean topLevel) { myContext = context; myPlace = place; myGroup = ActionRef.fromAction(group); myPresentationFactory = presentationFactory; myPresentation = myPresentationFactory.getPresentation(group); myMnemonicEnabled = enableMnemonics; myTopLevel = topLevel; updateUI(); init(); // addNotify won't be called for menus in MacOS system menu if (SystemInfo.isMacSystemMenu) { installSynchronizer(); } }
public ActionMenu(final DataContext context, @Nonnull final String place, final ActionGroup group, final PresentationFactory presentationFactory, final boolean enableMnemonics, final boolean topLevel) { myContext = context; myPlace = place; myGroup = ActionRef.fromAction(group); myPresentationFactory = presentationFactory; myPresentation = myPresentationFactory.getPresentation(group); myMnemonicEnabled = enableMnemonics; myTopLevel = topLevel; updateUI(); init(); // addNotify won't be called for menus in MacOS system menu if (SystemInfo.isMacSystemMenu) { installSynchronizer(); } if (UIUtil.isUnderIntelliJLaF()) { setOpaque(true); } }
public ActionMenu(final DataContext context, @NotNull final String place, final ActionGroup group, final PresentationFactory presentationFactory, final boolean enableMnemonics, final boolean topLevel) { myContext = context; myPlace = place; myGroup = ActionRef.fromAction(group); myPresentationFactory = presentationFactory; myPresentation = myPresentationFactory.getPresentation(group); myMnemonicEnabled = enableMnemonics; myTopLevel = topLevel; updateUI(); init(); // addNotify won't be called for menus in MacOS system menu if (SystemInfo.isMacSystemMenu) { installSynchronizer(); } if (UIUtil.isUnderIntelliJLaF()) { setOpaque(true); } myDisposable = new Disposable() { @Override public void dispose() { } }; // Triggering initialization of private field "popupMenu" from JMenu with our own JBPopupMenu getPopupMenu(); }
public ActionMenuItem(final AnAction action, final Presentation presentation, @NotNull final String place, @NotNull DataContext context, final boolean enableMnemonics, final boolean prepareNow, final boolean insideCheckedGroup) { myAction = ActionRef.fromAction(action); myPresentation = presentation; myPlace = place; myContext = context; myEnableMnemonics = enableMnemonics; myToggleable = action instanceof Toggleable; myInsideCheckedGroup = insideCheckedGroup; myEvent = new AnActionEvent(null, context, place, myPresentation, ActionManager.getInstance(), 0); addActionListener(new ActionTransmitter()); setBorderPainted(false); updateUI(); if (prepareNow) { init(); } else { setText("loading..."); } }
public ActionMenuItem(final AnAction action, final Presentation presentation, @NotNull final String place, final DataContext context, final boolean enableMnemonics, final boolean prepareNow, final boolean insideCheckedGroup) { myAction = ActionRef.fromAction(action); myPresentation = presentation; myPlace = place; myContext = context; myEnableMnemonics = enableMnemonics; myToggleable = action instanceof Toggleable; myInsideCheckedGroup = insideCheckedGroup; myEvent = new AnActionEvent(null, context, place, myPresentation, ActionManager.getInstance(), 0); addActionListener(new ActionTransmitter()); setBorderPainted(false); updateUI(); if (prepareNow) { init(); } else { setText("loading..."); } }
public ActionMenuItem(final AnAction action, final Presentation presentation, @Nonnull final String place, @Nonnull DataContext context, final boolean enableMnemonics, final boolean prepareNow, final boolean insideCheckedGroup) { myAction = ActionRef.fromAction(action); myPresentation = presentation; myPlace = place; myContext = context; myEnableMnemonics = enableMnemonics; myToggleable = action instanceof Toggleable; myInsideCheckedGroup = insideCheckedGroup; myEvent = new AnActionEvent(null, context, place, myPresentation, ActionManager.getInstance(), 0, true, false); addActionListener(new ActionTransmitter()); setBorderPainted(false); updateUI(); if (prepareNow) { init(); } else { setText("loading..."); } }