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); } } }
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)); } }
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); }
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)); } }
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); }
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)); } }
@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; }