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

项目:consulo    文件:PopupFactoryImpl.java   
private void appendActionsFromGroup(@Nonnull ActionGroup actionGroup) {
  List<AnAction> newVisibleActions = ContainerUtil.newArrayListWithCapacity(100);
  Utils.expandActionGroup(false, actionGroup, newVisibleActions, this, myDataContext, myActionPlace, ActionManager.getInstance());
  for (AnAction action : newVisibleActions) {
    if (action == null) {
      LOG.error("null action in group " + actionGroup);
      continue;
    }
    if (action instanceof AnSeparator) {
      myPrependWithSeparator = true;
      mySeparatorText = ((AnSeparator)action).getText();
    }
    else {
      appendAction(action);
    }
  }
}
项目:intellij-ce-playground    文件:PopupFactoryImpl.java   
public void buildGroup(@NotNull ActionGroup actionGroup) {
  calcMaxIconSize(actionGroup);
  myEmptyIcon = myMaxIconHeight != -1 && myMaxIconWidth != -1 ? new EmptyIcon(myMaxIconWidth, myMaxIconHeight) : null;

  appendActionsFromGroup(actionGroup);

  if (myListModel.isEmpty()) {
    myListModel.add(new ActionItem(Utils.EMPTY_MENU_FILLER, Utils.NOTHING_HERE, null, false, null, false, null));
  }
}
项目:intellij-ce-playground    文件:UnversionedViewDialog.java   
private void registerShortcuts(@NotNull ActionGroup opActionGroup, @NotNull DataContext dataContext) {
  List<AnAction> opActions = new ArrayList<AnAction>();
  Utils.expandActionGroup(opActionGroup, opActions, new PresentationFactory(), dataContext, "", ActionManager.getInstance());
  for (AnAction action : opActions) {
    action.registerCustomShortcutSet(action.getShortcutSet(), myView);
  }

  // special shortcut for deleting a file
  AnAction deleteAction = ActionManager.getInstance().getAction("ChangesView.DeleteUnversioned.From.Dialog");
  deleteAction.registerCustomShortcutSet(CommonShortcuts.getDelete(), myView);
}
项目:tools-idea    文件:PopupFactoryImpl.java   
public void buildGroup(@NotNull ActionGroup actionGroup) {
  calcMaxIconSize(actionGroup);
  myEmptyIcon = myMaxIconHeight != -1 && myMaxIconWidth != -1 ? new EmptyIcon(myMaxIconWidth, myMaxIconHeight) : null;

  appendActionsFromGroup(actionGroup);

  if (myListModel.isEmpty()) {
    myListModel.add(new ActionItem(Utils.EMPTY_MENU_FILLER, Utils.NOTHING_HERE, false, null, false, null));
  }
}
项目:tools-idea    文件:UnversionedViewDialog.java   
private void registerShortcuts(@NotNull ActionGroup opActionGroup, @NotNull DataContext dataContext) {
  List<AnAction> opActions = new ArrayList<AnAction>();
  Utils.expandActionGroup(opActionGroup, opActions, new PresentationFactory(), dataContext, "", ActionManager.getInstance());
  for (AnAction action : opActions) {
    action.registerCustomShortcutSet(action.getShortcutSet(), myView);
  }

  // special shortcut for deleting a file
  AnAction deleteAction = ActionManager.getInstance().getAction("ChangesView.DeleteUnversioned.From.Dialog");
  deleteAction.registerCustomShortcutSet(CommonShortcuts.DELETE, myView);
}
项目:consulo    文件:PopupFactoryImpl.java   
public void buildGroup(@Nonnull ActionGroup actionGroup) {
  calcMaxIconSize(actionGroup);
  myEmptyIcon = myMaxIconHeight != -1 && myMaxIconWidth != -1 ? EmptyIcon.create(myMaxIconWidth, myMaxIconHeight) : null;

  appendActionsFromGroup(actionGroup);

  if (myListModel.isEmpty()) {
    myListModel.add(new ActionItem(Utils.EMPTY_MENU_FILLER, Utils.NOTHING_HERE, null, false, null, null, false, null));
  }
}
项目:consulo    文件:UnversionedViewDialog.java   
@Nonnull
public static List<AnAction> registerUnversionedActionsShortcuts(@Nonnull DataContext dataContext, @Nonnull JComponent component) {
  ActionManager manager = ActionManager.getInstance();
  List<AnAction> actions = ContainerUtil.newArrayList();

  Utils.expandActionGroup(LaterInvocator.isInModalContext(), getUnversionedActionGroup(), actions, new PresentationFactory(), dataContext, "", manager);
  for (AnAction action : actions) {
    action.registerCustomShortcutSet(action.getShortcutSet(), component);
  }

  return actions;
}