List of usage examples for com.intellij.openapi.actionSystem.ex ActionManagerEx fireAfterActionPerformed
public abstract void fireAfterActionPerformed(@NotNull AnAction action, @NotNull DataContext dataContext, @NotNull AnActionEvent event);
From source file:com.intellij.testFramework.fixtures.impl.CodeInsightTestFixtureImpl.java
License:Apache License
private boolean _performEditorAction(String actionId) { final DataContext dataContext = getEditorDataContext(); ActionManagerEx managerEx = ActionManagerEx.getInstanceEx(); AnAction action = managerEx.getAction(actionId); AnActionEvent event = new AnActionEvent(null, dataContext, ActionPlaces.UNKNOWN, new Presentation(), managerEx, 0);/* ww w . j a v a2 s .c o m*/ action.update(event); if (!event.getPresentation().isEnabled()) { return false; } managerEx.fireBeforeActionPerformed(action, dataContext, event); action.actionPerformed(event); managerEx.fireAfterActionPerformed(action, dataContext, event); return true; }
From source file:org.jetbrains.jet.plugin.JetLightCodeInsightFixtureTestCase.java
License:Apache License
protected boolean performNotWriteEditorAction(String actionId) { DataContext dataContext = ((EditorEx) myFixture.getEditor()).getDataContext(); ActionManagerEx managerEx = ActionManagerEx.getInstanceEx(); AnAction action = managerEx.getAction(actionId); AnActionEvent event = new AnActionEvent(null, dataContext, ActionPlaces.UNKNOWN, new Presentation(), managerEx, 0);//from w w w . ja v a 2 s . c o m action.update(event); if (!event.getPresentation().isEnabled()) { return false; } managerEx.fireBeforeActionPerformed(action, dataContext, event); action.actionPerformed(event); managerEx.fireAfterActionPerformed(action, dataContext, event); return true; }