Example usage for com.intellij.openapi.actionSystem IdeActions GROUP_COMMANDER_POPUP

List of usage examples for com.intellij.openapi.actionSystem IdeActions GROUP_COMMANDER_POPUP

Introduction

In this page you can find the example usage for com.intellij.openapi.actionSystem IdeActions GROUP_COMMANDER_POPUP.

Prototype

String GROUP_COMMANDER_POPUP

To view the source code for com.intellij.openapi.actionSystem IdeActions GROUP_COMMANDER_POPUP.

Click Source Link

Usage

From source file:com.intellij.ide.commander.CommanderPanel.java

License:Apache License

private void invokePopup(final Component c, final int x, final int y) {
    if (myBuilder == null)
        return;/*from  w w w.java 2 s  . c o  m*/

    if (myList.getSelectedIndices().length <= 1) {
        final int popupIndex = myList.locationToIndex(new Point(x, y));
        if (popupIndex >= 0) {
            myList.setSelectedIndex(popupIndex);
            myList.requestFocus();
        }
    }

    final ActionGroup group = (ActionGroup) CustomActionsSchema.getInstance()
            .getCorrectedAction(IdeActions.GROUP_COMMANDER_POPUP);
    final ActionPopupMenu popupMenu = ActionManager.getInstance()
            .createActionPopupMenu(ActionPlaces.COMMANDER_POPUP, group);
    popupMenu.getComponent().show(c, x, y);
}

From source file:com.intellij.ide.ui.customization.CustomActionsSchema.java

License:Apache License

public CustomActionsSchema() {
    myIdToNameList.add(new Pair(IdeActions.GROUP_MAIN_MENU, ActionsTreeUtil.MAIN_MENU_TITLE));
    myIdToNameList.add(new Pair(IdeActions.GROUP_MAIN_TOOLBAR, ActionsTreeUtil.MAIN_TOOLBAR));
    myIdToNameList.add(new Pair(IdeActions.GROUP_EDITOR_POPUP, ActionsTreeUtil.EDITOR_POPUP));
    myIdToNameList.add(new Pair(IdeActions.GROUP_EDITOR_GUTTER, "Editor Gutter Popup Menu"));
    myIdToNameList.add(new Pair(IdeActions.GROUP_EDITOR_TAB_POPUP, ActionsTreeUtil.EDITOR_TAB_POPUP));
    myIdToNameList.add(new Pair(IdeActions.GROUP_PROJECT_VIEW_POPUP, ActionsTreeUtil.PROJECT_VIEW_POPUP));
    myIdToNameList.add(new Pair(IdeActions.GROUP_SCOPE_VIEW_POPUP, "Scope View Popup Menu"));
    myIdToNameList.add(new Pair(IdeActions.GROUP_FAVORITES_VIEW_POPUP, ActionsTreeUtil.FAVORITES_POPUP));
    myIdToNameList.add(new Pair(IdeActions.GROUP_COMMANDER_POPUP, ActionsTreeUtil.COMMANDER_POPUP));
    myIdToNameList.add(new Pair(IdeActions.GROUP_J2EE_VIEW_POPUP, ActionsTreeUtil.J2EE_POPUP));
    myIdToNameList.add(new Pair(IdeActions.GROUP_NAVBAR_POPUP, "Navigation Bar"));
    myIdToNameList.add(new Pair("NavBarToolBar", "Navigation Bar Toolbar"));

    CustomizableActionGroupProvider.CustomizableActionGroupRegistrar registrar = new CustomizableActionGroupProvider.CustomizableActionGroupRegistrar() {
        @Override/*w ww .  j a  va2 s. co m*/
        public void addCustomizableActionGroup(@NotNull String groupId, @NotNull String groupTitle) {
            myIdToNameList.add(new Pair(groupId, groupTitle));
        }
    };
    for (CustomizableActionGroupProvider provider : CustomizableActionGroupProvider.EP_NAME.getExtensions()) {
        provider.registerGroups(registrar);
    }
}