Skip to content

Commit 201e508

Browse files
authored
Add warning message for removing performance panel (#7577)
<img width="511" alt="Screenshot 2024-07-26 at 1 17 17 PM" src="https://github.com/user-attachments/assets/73d6745b-0ada-4def-b5b0-d62c67d52875">
1 parent 6acd928 commit 201e508

File tree

1 file changed

+19
-0
lines changed

1 file changed

+19
-0
lines changed

flutter-idea/src/io/flutter/performance/FlutterPerformanceView.java

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,7 @@
3636
import io.flutter.run.daemon.DevToolsService;
3737
import io.flutter.run.daemon.FlutterApp;
3838
import io.flutter.sdk.FlutterSdk;
39+
import io.flutter.sdk.FlutterSdkVersion;
3940
import io.flutter.utils.AsyncUtils;
4041
import io.flutter.utils.VmServiceListenerAdapter;
4142
import io.flutter.view.*;
@@ -184,6 +185,24 @@ private void addPerformanceViewContent(FlutterApp app, ToolWindow toolWindow) {
184185
toolWindowPanel.setToolbar(ActionManager.getInstance().createActionToolbar(
185186
"FlutterPerfViewToolbar", toolbarGroup, true).getComponent());
186187

188+
FlutterSdk sdk = FlutterSdk.getFlutterSdk(app.getProject());
189+
FlutterSdkVersion sdkVersion = sdk == null ? null : sdk.getVersion();
190+
if (sdkVersion != null && sdkVersion.canUseDevToolsMultiEmbed()) {
191+
final JPanel warning = new JPanel(new BorderLayout(50, 50));
192+
JTextArea area = new JTextArea(
193+
"The performance panel is being removed soon. Use the Flutter DevTools panel instead: View -> Tool windows -> Flutter DevTools");
194+
area.setBorder(BorderFactory.createEmptyBorder(20, 20, 20, 20));
195+
area.setLineWrap(true);
196+
area.setWrapStyleWord(true);
197+
area.setOpaque(false);
198+
area.setEditable(false);
199+
area.setFocusable(false);
200+
area.setFont(UIManager.getFont("Label.font").deriveFont(Font.BOLD));
201+
area.setBackground(UIManager.getColor("Label.background"));
202+
warning.add(area);
203+
perfViewsPanel.add(warning);
204+
}
205+
187206
final ActionToolbar toolbar = ActionManager.getInstance().createActionToolbar("PerformanceToolbar", toolbarGroup, true);
188207
final JComponent toolbarComponent = toolbar.getComponent();
189208
toolbarComponent.setBorder(IdeBorderFactory.createBorder(SideBorder.BOTTOM));

0 commit comments

Comments
 (0)