Search in sources :

Example 76 with AnAction

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

the class GradleTestsExecutionConsoleManager method getRestartActions.

@Override
public AnAction[] getRestartActions(@NotNull final GradleTestsExecutionConsole consoleView) {
    JavaRerunFailedTestsAction rerunFailedTestsAction = new GradleRerunFailedTestsAction(consoleView);
    rerunFailedTestsAction.setModelProvider(() -> consoleView.getResultsViewer());
    return new AnAction[] { rerunFailedTestsAction };
}
Also used : GradleRerunFailedTestsAction(org.jetbrains.plugins.gradle.action.GradleRerunFailedTestsAction) JavaRerunFailedTestsAction(com.intellij.execution.actions.JavaRerunFailedTestsAction) AnAction(com.intellij.openapi.actionSystem.AnAction)

Example 77 with AnAction

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

the class ApplyGradlePluginCallback method hyperlinkActivated.

@Override
protected void hyperlinkActivated(@NotNull Notification notification, @NotNull HyperlinkEvent event) {
    new GotoSourceNotificationCallback(myNotificationData, myProject).hyperlinkActivated(notification, event);
    final AnAction action = ActionManager.getInstance().getAction(AddGradleDslPluginAction.ID);
    assert action instanceof AddGradleDslPluginAction;
    final AddGradleDslPluginAction addGradleDslPluginAction = (AddGradleDslPluginAction) action;
    ActionManager.getInstance().tryToExecute(addGradleDslPluginAction, ActionCommand.getInputEvent(AddGradleDslPluginAction.ID), null, ActionPlaces.UNKNOWN, true);
}
Also used : AddGradleDslPluginAction(org.jetbrains.plugins.gradle.codeInsight.actions.AddGradleDslPluginAction) AnAction(com.intellij.openapi.actionSystem.AnAction)

Example 78 with AnAction

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

the class QuickChangeCodeStyleSchemeAction method fillActions.

@Override
protected void fillActions(Project project, @NotNull DefaultActionGroup group, @NotNull DataContext dataContext) {
    final CodeStyleSettingsManager manager = CodeStyleSettingsManager.getInstance(project);
    if (manager.PER_PROJECT_SETTINGS != null) {
        //noinspection HardCodedStringLiteral
        group.add(new AnAction("<project>", "", manager.USE_PER_PROJECT_SETTINGS ? ourCurrentAction : ourNotCurrentAction) {

            @Override
            public void actionPerformed(@NotNull AnActionEvent e) {
                manager.USE_PER_PROJECT_SETTINGS = true;
            }
        });
    }
    CodeStyleScheme currentScheme = CodeStyleSchemes.getInstance().getCurrentScheme();
    for (CodeStyleScheme scheme : CodeStyleSchemesImpl.getSchemeManager().getAllSchemes()) {
        addScheme(group, manager, currentScheme, scheme, false);
    }
}
Also used : CodeStyleSettingsManager(com.intellij.psi.codeStyle.CodeStyleSettingsManager) CodeStyleScheme(com.intellij.psi.codeStyle.CodeStyleScheme) AnActionEvent(com.intellij.openapi.actionSystem.AnActionEvent) AnAction(com.intellij.openapi.actionSystem.AnAction)

Example 79 with AnAction

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

the class AutoPopupController method setupListeners.

private void setupListeners() {
    ActionManagerEx.getInstanceEx().addAnActionListener(new AnActionListener() {

        @Override
        public void beforeActionPerformed(AnAction action, DataContext dataContext, AnActionEvent event) {
            cancelAllRequest();
        }

        @Override
        public void beforeEditorTyping(char c, DataContext dataContext) {
            cancelAllRequest();
        }

        @Override
        public void afterActionPerformed(final AnAction action, final DataContext dataContext, AnActionEvent event) {
        }
    }, this);
    IdeEventQueue.getInstance().addActivityListener(() -> cancelAllRequest(), this);
}
Also used : DataContext(com.intellij.openapi.actionSystem.DataContext) AnActionListener(com.intellij.openapi.actionSystem.ex.AnActionListener) AnActionEvent(com.intellij.openapi.actionSystem.AnActionEvent) AnAction(com.intellij.openapi.actionSystem.AnAction)

Example 80 with AnAction

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

the class UseConsoleInputAction method setSelected.

@Override
public void setSelected(AnActionEvent event, boolean state) {
    useProcessStdIn = !state;
    LanguageConsoleView consoleView = (LanguageConsoleView) event.getData(LangDataKeys.CONSOLE_VIEW);
    assert consoleView != null;
    DaemonCodeAnalyzer daemonCodeAnalyzer = DaemonCodeAnalyzer.getInstance(consoleView.getProject());
    PsiFile file = consoleView.getFile();
    daemonCodeAnalyzer.setHighlightingEnabled(file, state);
    daemonCodeAnalyzer.restart(file);
    PropertiesComponent.getInstance().setValue(processInputStateKey, useProcessStdIn);
    List<AnAction> actions = ActionUtil.getActions(consoleView.getConsoleEditor().getComponent());
    ConsoleExecuteAction action = ContainerUtil.findInstance(actions, ConsoleExecuteAction.class);
    action.myExecuteActionHandler.myUseProcessStdIn = !state;
}
Also used : DaemonCodeAnalyzer(com.intellij.codeInsight.daemon.DaemonCodeAnalyzer) PsiFile(com.intellij.psi.PsiFile) AnAction(com.intellij.openapi.actionSystem.AnAction)

Aggregations

AnAction (com.intellij.openapi.actionSystem.AnAction)184 AnActionEvent (com.intellij.openapi.actionSystem.AnActionEvent)62 NotNull (org.jetbrains.annotations.NotNull)31 Project (com.intellij.openapi.project.Project)24 Nullable (org.jetbrains.annotations.Nullable)22 ActionManager (com.intellij.openapi.actionSystem.ActionManager)21 DefaultActionGroup (com.intellij.openapi.actionSystem.DefaultActionGroup)21 CustomShortcutSet (com.intellij.openapi.actionSystem.CustomShortcutSet)13 ArrayList (java.util.ArrayList)13 DumbAwareAction (com.intellij.openapi.project.DumbAwareAction)8 VirtualFile (com.intellij.openapi.vfs.VirtualFile)8 ActionGroup (com.intellij.openapi.actionSystem.ActionGroup)7 Presentation (com.intellij.openapi.actionSystem.Presentation)7 PsiFile (com.intellij.psi.PsiFile)7 ReopenProjectAction (com.intellij.ide.ReopenProjectAction)6 Editor (com.intellij.openapi.editor.Editor)6 Keymap (com.intellij.openapi.keymap.Keymap)6 Ref (com.intellij.openapi.util.Ref)6 List (java.util.List)6 DataContext (com.intellij.openapi.actionSystem.DataContext)5