Skip to content

[CQ] migrate from slated-for-removal ActionEvent APIs #8018

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
Apr 17, 2025
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}
Expand Down Expand Up @@ -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());
Expand All @@ -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() {
Expand Down