Skip to content

Commit

Permalink
Fix missed deprecations for action update thread (#7435)
Browse files Browse the repository at this point in the history
Fixes #7427
  • Loading branch information
helin24 committed May 21, 2024
1 parent af0c34d commit bd96b52
Show file tree
Hide file tree
Showing 3 changed files with 26 additions and 4 deletions.
5 changes: 5 additions & 0 deletions flutter-idea/src/io/flutter/preview/PreviewView.java
Original file line number Diff line number Diff line change
Expand Up @@ -695,6 +695,11 @@ public void update(AnActionEvent e) {
presentation.putClientProperty(SELECTED_PROPERTY, FlutterSettings.getInstance().isShowOnlyWidgets());
presentation.setEnabled(currentOutline != null);
}

@Override
public @NotNull ActionUpdateThread getActionUpdateThread() {
return ActionUpdateThread.BGT;
}
}
}

Expand Down
15 changes: 15 additions & 0 deletions flutter-idea/src/io/flutter/preview/WidgetEditToolbar.java
Original file line number Diff line number Diff line change
Expand Up @@ -73,6 +73,11 @@ public void update(AnActionEvent e) {
e.getPresentation().setEnabled(hasChange);
}

@Override
public @NotNull ActionUpdateThread getActionUpdateThread() {
return ActionUpdateThread.BGT;
}

boolean isEnabled() {
return actionToChangeMap.containsKey(this);
}
Expand Down Expand Up @@ -118,6 +123,11 @@ public void update(AnActionEvent e) {
e.getPresentation().setEnabled(isEnabled);
}

@Override
public @NotNull ActionUpdateThread getActionUpdateThread() {
return ActionUpdateThread.BGT;
}

boolean isEnabled() {
return getWidgetOutline() != null && getCurrentEditor() != null;
}
Expand Down Expand Up @@ -156,6 +166,11 @@ public void update(AnActionEvent e) {
e.getPresentation().setEnabled(isEnabled);
}

@Override
public @NotNull ActionUpdateThread getActionUpdateThread() {
return ActionUpdateThread.BGT;
}

boolean isEnabled() {
return getWidgetOutline() != null && getCurrentEditor() != null;
}
Expand Down
10 changes: 6 additions & 4 deletions flutter-idea/src/io/flutter/run/FlutterPopFrameAction.java
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,7 @@
package io.flutter.run;

import com.intellij.icons.AllIcons;
import com.intellij.openapi.actionSystem.ActionPlaces;
import com.intellij.openapi.actionSystem.AnAction;
import com.intellij.openapi.actionSystem.AnActionEvent;
import com.intellij.openapi.actionSystem.Presentation;
import com.intellij.openapi.actionSystem.*;
import com.intellij.openapi.project.DumbAware;
import com.intellij.openapi.project.Project;
import com.intellij.xdebugger.XDebugSession;
Expand Down Expand Up @@ -47,6 +44,11 @@ public void update(@NotNull AnActionEvent e) {
}
}

@Override
public @NotNull ActionUpdateThread getActionUpdateThread() {
return ActionUpdateThread.BGT;
}

@Nullable
private static DartVmServiceStackFrame getStackFrame(@NotNull final AnActionEvent e) {
final Project project = e.getProject();
Expand Down

0 comments on commit bd96b52

Please sign in to comment.