Search in sources :

Example 1 with ActionManager

use of com.intellij.openapi.actionSystem.ActionManager in project buck by facebook.

the class BuckToolWindowFactory method getLeftToolbarActions.

public ActionGroup getLeftToolbarActions(final Project project) {
    ActionManager actionManager = ActionManager.getInstance();
    DefaultActionGroup group = new DefaultActionGroup();
    group.add(actionManager.getAction("buck.ChooseTarget"));
    group.addSeparator();
    group.add(actionManager.getAction("buck.Build"));
    group.add(actionManager.getAction("buck.Test"));
    group.add(actionManager.getAction("buck.Install"));
    group.add(actionManager.getAction("buck.InstallDebug"));
    group.add(actionManager.getAction("buck.Uninstall"));
    group.add(actionManager.getAction("buck.Kill"));
    group.add(actionManager.getAction("buck.ProjectGeneration"));
    Logger.getInstance(this.getClass()).info("getLeftToolbarActions");
    return group;
}
Also used : ActionManager(com.intellij.openapi.actionSystem.ActionManager) DefaultActionGroup(com.intellij.openapi.actionSystem.DefaultActionGroup)

Example 2 with ActionManager

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

the class SvnQuickListContentProvider method getVcsActions.

public List<AnAction> getVcsActions(@Nullable Project project, @Nullable AbstractVcs activeVcs, @Nullable DataContext dataContext) {
    if (activeVcs == null || !SvnVcs.VCS_NAME.equals(activeVcs.getName())) {
        return null;
    }
    final ActionManager manager = ActionManager.getInstance();
    final List<AnAction> actions = new ArrayList<>();
    add("Subversion.Copy", manager, actions);
    add("Subversion.Clenaup", manager, actions);
    return actions;
}
Also used : ActionManager(com.intellij.openapi.actionSystem.ActionManager) ArrayList(java.util.ArrayList) AnAction(com.intellij.openapi.actionSystem.AnAction)

Example 3 with ActionManager

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

the class PyCharmEduInitialConfigurator method unregisterAction.

private static void unregisterAction(String actionId, String groupId) {
    ActionManager actionManager = ActionManager.getInstance();
    AnAction action = actionManager.getAction(actionId);
    if (action != null) {
        AnAction actionGroup = actionManager.getAction(groupId);
        if (actionGroup != null && actionGroup instanceof DefaultActionGroup) {
            ((DefaultActionGroup) actionGroup).remove(action);
            actionManager.unregisterAction(actionId);
        }
    }
}
Also used : ActionManager(com.intellij.openapi.actionSystem.ActionManager) AnAction(com.intellij.openapi.actionSystem.AnAction) DefaultActionGroup(com.intellij.openapi.actionSystem.DefaultActionGroup)

Example 4 with ActionManager

use of com.intellij.openapi.actionSystem.ActionManager in project ideavim by JetBrains.

the class KeyHandler method executeAction.

/**
   * Execute an action by name
   *
   * @param name    The name of the action to execute
   * @param context The context to run it in
   */
public static boolean executeAction(@NotNull String name, @NotNull DataContext context) {
    ActionManager aMgr = ActionManager.getInstance();
    AnAction action = aMgr.getAction(name);
    return action != null && executeAction(action, context);
}
Also used : ActionManager(com.intellij.openapi.actionSystem.ActionManager) AnAction(com.intellij.openapi.actionSystem.AnAction)

Example 5 with ActionManager

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

the class MacGestureAdapter method swipedRight.

@Override
public void swipedRight(SwipeEvent event) {
    ActionManager actionManager = ActionManager.getInstance();
    AnAction back = actionManager.getAction("Back");
    if (back == null)
        return;
    actionManager.tryToExecute(back, createMouseEventWrapper(myFrame), null, null, false);
}
Also used : ActionManager(com.intellij.openapi.actionSystem.ActionManager) AnAction(com.intellij.openapi.actionSystem.AnAction)

Aggregations

ActionManager (com.intellij.openapi.actionSystem.ActionManager)43 AnAction (com.intellij.openapi.actionSystem.AnAction)27 DefaultActionGroup (com.intellij.openapi.actionSystem.DefaultActionGroup)15 ActionGroup (com.intellij.openapi.actionSystem.ActionGroup)4 ActionToolbar (com.intellij.openapi.actionSystem.ActionToolbar)4 MouseEvent (java.awt.event.MouseEvent)4 Keymap (com.intellij.openapi.keymap.Keymap)3 IOException (java.io.IOException)3 ArrayList (java.util.ArrayList)3 ActionPopupMenu (com.intellij.openapi.actionSystem.ActionPopupMenu)2 AnActionEvent (com.intellij.openapi.actionSystem.AnActionEvent)2 Presentation (com.intellij.openapi.actionSystem.Presentation)2 ActionManagerImpl (com.intellij.openapi.actionSystem.impl.ActionManagerImpl)2 Application (com.intellij.openapi.application.Application)2 ToolWindow (com.intellij.openapi.wm.ToolWindow)2 IntellijAzureActionManager (com.microsoft.azure.toolkit.intellij.common.action.IntellijAzureActionManager)2 File (java.io.File)2 NotificationHyperlink (com.android.tools.idea.gradle.project.sync.hyperlink.NotificationHyperlink)1 CloudDebugHelpAction (com.google.cloud.tools.intellij.debugger.actions.CloudDebugHelpAction)1 DataManager (com.intellij.ide.DataManager)1