Java 类com.intellij.openapi.actionSystem.impl.actionholder.ActionRef 实例源码

项目:IntelliJ-Key-Promoter-X    文件:KeyPromoterAction.java   
/**
 * 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..
        }
    }
}
项目:tools-idea    文件:ActionMenu.java   
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();
  }
}
项目:consulo    文件:ActionMenu.java   
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);
  }
}
项目:intellij-ce-playground    文件:ActionMenu.java   
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();
}
项目:intellij-ce-playground    文件:ActionMenuItem.java   
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...");
  }
}
项目:tools-idea    文件:ActionMenuItem.java   
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...");
  }
}
项目:consulo    文件:ActionMenuItem.java   
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...");
  }
}