Search in sources :

Example 1 with ActionButtonComponent

use of com.intellij.openapi.actionSystem.ActionButtonComponent in project intellij-community by JetBrains.

the class VcsLogGearActionGroup method actionPerformed.

@Override
public void actionPerformed(@NotNull AnActionEvent e) {
    DefaultActionGroup group = new DefaultActionGroup(ActionManager.getInstance().getAction(myActionGroup));
    ListPopup popup = JBPopupFactory.getInstance().createActionGroupPopup(null, group, e.getDataContext(), JBPopupFactory.ActionSelectionAid.MNEMONICS, true, ToolWindowContentUi.POPUP_PLACE);
    Component component = e.getInputEvent().getComponent();
    if (component instanceof ActionButtonComponent) {
        popup.showUnderneathOf(component);
    } else {
        popup.showInCenterOf(component);
    }
}
Also used : ActionButtonComponent(com.intellij.openapi.actionSystem.ActionButtonComponent) ListPopup(com.intellij.openapi.ui.popup.ListPopup) ActionButtonComponent(com.intellij.openapi.actionSystem.ActionButtonComponent) DefaultActionGroup(com.intellij.openapi.actionSystem.DefaultActionGroup)

Aggregations

ActionButtonComponent (com.intellij.openapi.actionSystem.ActionButtonComponent)1 DefaultActionGroup (com.intellij.openapi.actionSystem.DefaultActionGroup)1 ListPopup (com.intellij.openapi.ui.popup.ListPopup)1