|
36 | 36 | import io.flutter.run.daemon.DevToolsService;
|
37 | 37 | import io.flutter.run.daemon.FlutterApp;
|
38 | 38 | import io.flutter.sdk.FlutterSdk;
|
| 39 | +import io.flutter.sdk.FlutterSdkVersion; |
39 | 40 | import io.flutter.utils.AsyncUtils;
|
40 | 41 | import io.flutter.utils.VmServiceListenerAdapter;
|
41 | 42 | import io.flutter.view.*;
|
@@ -184,6 +185,24 @@ private void addPerformanceViewContent(FlutterApp app, ToolWindow toolWindow) {
|
184 | 185 | toolWindowPanel.setToolbar(ActionManager.getInstance().createActionToolbar(
|
185 | 186 | "FlutterPerfViewToolbar", toolbarGroup, true).getComponent());
|
186 | 187 |
|
| 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 | + |
187 | 206 | final ActionToolbar toolbar = ActionManager.getInstance().createActionToolbar("PerformanceToolbar", toolbarGroup, true);
|
188 | 207 | final JComponent toolbarComponent = toolbar.getComponent();
|
189 | 208 | toolbarComponent.setBorder(IdeBorderFactory.createBorder(SideBorder.BOTTOM));
|
|
0 commit comments