mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-09-27 10:03:11 +07:00
Extract action invoke with before/after callbacks in a separate method
IDEA-CR-32439 (cherry picked from commit 0f19bc7)
This commit is contained in:
@@ -212,6 +212,13 @@ public class ActionUtil {
|
||||
return true;
|
||||
}
|
||||
|
||||
public static void performActionDumbAwareWithCallbacks(AnAction action, AnActionEvent e, DataContext context) {
|
||||
final ActionManagerEx manager = ActionManagerEx.getInstanceEx();
|
||||
manager.fireBeforeActionPerformed(action, context, e);
|
||||
performActionDumbAware(action, e);
|
||||
manager.fireAfterActionPerformed(action, context, e);
|
||||
}
|
||||
|
||||
public static void performActionDumbAware(AnAction action, AnActionEvent e) {
|
||||
Runnable runnable = new Runnable() {
|
||||
@Override
|
||||
|
||||
@@ -2,7 +2,6 @@
|
||||
package com.intellij.ui.popup;
|
||||
|
||||
import com.intellij.openapi.actionSystem.*;
|
||||
import com.intellij.openapi.actionSystem.ex.ActionManagerEx;
|
||||
import com.intellij.openapi.actionSystem.ex.ActionUtil;
|
||||
import com.intellij.openapi.ui.popup.*;
|
||||
import com.intellij.openapi.util.Condition;
|
||||
@@ -198,10 +197,7 @@ public class ActionPopupStep implements ListPopupStepEx<PopupFactoryImpl.ActionI
|
||||
ActionManager.getInstance(), modifiers);
|
||||
event.setInjectedContext(action.isInInjectedContext());
|
||||
if (ActionUtil.lastUpdateAndCheckDumb(action, event, false)) {
|
||||
final ActionManagerEx manager = ActionManagerEx.getInstanceEx();
|
||||
manager.fireBeforeActionPerformed(action, dataContext, event);
|
||||
ActionUtil.performActionDumbAware(action, event);
|
||||
manager.fireAfterActionPerformed(action, dataContext, event);
|
||||
ActionUtil.performActionDumbAwareWithCallbacks(action, event, dataContext);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
+1
-5
@@ -129,11 +129,7 @@ public class EditorTestFixture {
|
||||
return false;
|
||||
}
|
||||
|
||||
managerEx.fireBeforeActionPerformed(action, dataContext, event);
|
||||
|
||||
ActionUtil.performActionDumbAware(action, event);
|
||||
|
||||
managerEx.fireAfterActionPerformed(action, dataContext, event);
|
||||
ActionUtil.performActionDumbAwareWithCallbacks(action, event, dataContext);
|
||||
return true;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user