Skip to content

Commit b4e4989

Browse files
authored
[CQ] migrate from slated-for-removal ActionEvent APIs (#8018)
`AnActionEvent.createFromDataContext` is slated for removal. **EDIT:** Hrmmm. Not sure how we're supposed to migrate if `ActionUiKind` is unavailable. (Will have to research.) See: #7718. ## Pre-launch Checklist - [x] I read the [Contributor Guide] and followed the process outlined there for submitting PRs. - [x] I read the [Tree Hygiene] wiki page, which explains my responsibilities. - [x] I read the [Flutter Style Guide] _recently_, and have followed its advice. - [x] I signed the [CLA]. - [x] I listed at least one issue that this PR fixes in the description above. - [x] I updated/added relevant documentation (doc comments with `///`). - [x] I added new tests to check the change I am making, or this PR is [test-exempt]. - [x] All existing and new tests are passing. If you need help, consider asking for advice on the #hackers-new channel on [Discord]. <!-- Links --> [Contributor Guide]: https://github.com/flutter/flutter/blob/master/docs/contributing/Tree-hygiene.md#overview [Tree Hygiene]: https://github.com/flutter/flutter/blob/master/docs/contributing/Tree-hygiene.md [test-exempt]: https://github.com/flutter/flutter/blob/master/docs/contributing/Tree-hygiene.md#tests [Flutter Style Guide]: https://github.com/flutter/flutter/blob/master/docs/contributing/Style-guide-for-Flutter-repo.md [CLA]: https://cla.developers.google.com/ [flutter/tests]: https://github.com/flutter/tests [breaking change policy]: https://github.com/flutter/flutter/blob/master/docs/contributing/Tree-hygiene.md#handling-breaking-changes [Discord]: https://github.com/flutter/flutter/blob/master/docs/contributing/Chat.md
1 parent ff599f5 commit b4e4989

File tree

1 file changed

+7
-3
lines changed

1 file changed

+7
-3
lines changed

flutter-idea/src/io/flutter/editor/NativeEditorNotificationProvider.java

+7-3
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,9 @@ public NativeEditorNotificationProvider(@NotNull Project project) {
4646
}
4747

4848
@Nullable
49-
private EditorNotificationPanel createPanelForAction(@NotNull FileEditor fileEditor, @NotNull VirtualFile root, @Nullable String actionName) {
49+
private EditorNotificationPanel createPanelForAction(@NotNull FileEditor fileEditor,
50+
@NotNull VirtualFile root,
51+
@Nullable String actionName) {
5052
if (actionName == null) {
5153
return null;
5254
}
@@ -113,7 +115,9 @@ class NativeEditorActionsPanel extends EditorNotificationPanel {
113115
text("Flutter commands");
114116

115117
// Ensure this project is a Flutter project by updating the menu action. It will only be visible for Flutter projects.
116-
myAction.update(AnActionEvent.createFromDataContext(ActionPlaces.EDITOR_TOOLBAR, myAction.getTemplatePresentation(), makeContext()));
118+
myAction.update(
119+
AnActionEvent.createEvent(makeContext(), myAction.getTemplatePresentation(), ActionPlaces.EDITOR_TOOLBAR, ActionUiKind.NONE, null));
120+
117121
isVisible = myAction.getTemplatePresentation().isVisible();
118122
createActionLabel(myAction.getTemplatePresentation().getText(), this::performAction)
119123
.setToolTipText(myAction.getTemplatePresentation().getDescription());
@@ -134,7 +138,7 @@ private boolean isValidForFile() {
134138
private void performAction() {
135139
// Open Xcode or Android Studio. If already running AS then just open a new window.
136140
myAction.actionPerformed(
137-
AnActionEvent.createFromDataContext(ActionPlaces.EDITOR_TOOLBAR, myAction.getTemplatePresentation(), makeContext()));
141+
AnActionEvent.createEvent(makeContext(), myAction.getTemplatePresentation(), ActionPlaces.EDITOR_TOOLBAR, ActionUiKind.NONE, null));
138142
}
139143

140144
private DataContext makeContext() {

0 commit comments

Comments
 (0)