Search in sources :

Example 1 with MenuItemPresentationFactory

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

the class ToolWindowContentUi method showContextMenu.

public void showContextMenu(Component comp, int x, int y, ActionGroup toolWindowGroup, @Nullable Content selectedContent) {
    if (selectedContent == null && toolWindowGroup == null) {
        return;
    }
    DefaultActionGroup group = new DefaultActionGroup();
    if (selectedContent != null) {
        initActionGroup(group, selectedContent);
    }
    if (toolWindowGroup != null) {
        group.addAll(toolWindowGroup);
    }
    final ActionPopupMenu popupMenu = ((ActionManagerImpl) ActionManager.getInstance()).createActionPopupMenu(POPUP_PLACE, group, new MenuItemPresentationFactory(true));
    popupMenu.getComponent().show(comp, x, y);
}
Also used : ActionManagerImpl(com.intellij.openapi.actionSystem.impl.ActionManagerImpl) MenuItemPresentationFactory(com.intellij.openapi.actionSystem.impl.MenuItemPresentationFactory)

Example 2 with MenuItemPresentationFactory

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

the class LightToolWindow method showGearPopup.

private void showGearPopup(Component component, int x, int y) {
    ActionPopupMenu popupMenu = ((ActionManagerImpl) ActionManager.getInstance()).createActionPopupMenu(ToolWindowContentUi.POPUP_PLACE, createGearPopupGroup(), new MenuItemPresentationFactory(true));
    popupMenu.getComponent().show(component, x, y);
}
Also used : ActionManagerImpl(com.intellij.openapi.actionSystem.impl.ActionManagerImpl) MenuItemPresentationFactory(com.intellij.openapi.actionSystem.impl.MenuItemPresentationFactory)

Aggregations

ActionManagerImpl (com.intellij.openapi.actionSystem.impl.ActionManagerImpl)2 MenuItemPresentationFactory (com.intellij.openapi.actionSystem.impl.MenuItemPresentationFactory)2