From ed8587f70a3ca3e402c44fdeddbf30fc1aaf7d7e Mon Sep 17 00:00:00 2001 From: pq Date: Tue, 8 Apr 2025 12:57:41 -0700 Subject: [PATCH] [CQ] migrate from slated-for-removal ActionEvent APIs --- .../editor/NativeEditorNotificationProvider.java | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/flutter-idea/src/io/flutter/editor/NativeEditorNotificationProvider.java b/flutter-idea/src/io/flutter/editor/NativeEditorNotificationProvider.java index 90fcf6534..f0225ad22 100644 --- a/flutter-idea/src/io/flutter/editor/NativeEditorNotificationProvider.java +++ b/flutter-idea/src/io/flutter/editor/NativeEditorNotificationProvider.java @@ -46,7 +46,9 @@ public NativeEditorNotificationProvider(@NotNull Project project) { } @Nullable - private EditorNotificationPanel createPanelForAction(@NotNull FileEditor fileEditor, @NotNull VirtualFile root, @Nullable String actionName) { + private EditorNotificationPanel createPanelForAction(@NotNull FileEditor fileEditor, + @NotNull VirtualFile root, + @Nullable String actionName) { if (actionName == null) { return null; } @@ -113,7 +115,9 @@ class NativeEditorActionsPanel extends EditorNotificationPanel { text("Flutter commands"); // Ensure this project is a Flutter project by updating the menu action. It will only be visible for Flutter projects. - myAction.update(AnActionEvent.createFromDataContext(ActionPlaces.EDITOR_TOOLBAR, myAction.getTemplatePresentation(), makeContext())); + myAction.update( + AnActionEvent.createEvent(makeContext(), myAction.getTemplatePresentation(), ActionPlaces.EDITOR_TOOLBAR, ActionUiKind.NONE, null)); + isVisible = myAction.getTemplatePresentation().isVisible(); createActionLabel(myAction.getTemplatePresentation().getText(), this::performAction) .setToolTipText(myAction.getTemplatePresentation().getDescription()); @@ -134,7 +138,7 @@ private boolean isValidForFile() { private void performAction() { // Open Xcode or Android Studio. If already running AS then just open a new window. myAction.actionPerformed( - AnActionEvent.createFromDataContext(ActionPlaces.EDITOR_TOOLBAR, myAction.getTemplatePresentation(), makeContext())); + AnActionEvent.createEvent(makeContext(), myAction.getTemplatePresentation(), ActionPlaces.EDITOR_TOOLBAR, ActionUiKind.NONE, null)); } private DataContext makeContext() {